Distinct and Count of BES property

(imported topic written by jerry91)

Hello,

I am new to relevance. I have been searching this forum for a solution that I thought would be simple, but I just cannot figure it out. How do I get a list of the distinct values of bes property “x” and its count?

For example:

value count

a 12

b 1

c 5

d 6

Thanks,

Jer

(imported comment written by NoahSalzman)

This function is built into the Console. Create an Analysis that returns that property and then go to the Results tab of the Analysis.

(imported comment written by cstoneba)

http://forum.bigfix.com/viewtopic.php?id=6233

(imported comment written by jerry91)

I understand this information is available in the Console. I am trying to obtain this information via SOAP as I have to automate the export of the data into another (non-BigFix) database.

I looked at the thread that cstoneba suggested and it looks like that is what I am looking for, however I get stuck in modifying it for my purpose. So far I have:

(it, multiplicity of it) of unique values of values of results (bes property whose (name of it = “X”), computers of results whose (relevant flag of it = true) of (bes fixlets whose (name of it starts with “” and fixlet flag of it = true)))

This lists the unique values of property “X”, but still lists the count of relevant fixlets. How do I modify the last bit where it will list the count of computers?

Thanks!

(imported comment written by jerry91)

I found the following that works for me:

(it & ", " & multiplicity of it as string) of unique values of (value of result from (bes property whose (name of it = “X”)) of it) of bes computers

Thanks everyone for pointing me in the right direction.

(imported comment written by SystemAdmin)

Thanks to Jerry, it works fine for me too.

But with more than 84.000 computers I got the answer in about 2 minutes; is there a way to optimize this relevance ?

Consider that if I run this SQL query (yes, I know, it’s not recommended)

select distinct(value), count(*)

from bes_column_headings

where name = ‘property’

group by value

… response time is 5 seconds !!!

Thanks.