BigFix relevance query not returning all Device data via REST API

Hi,

Currently we have 45 000 Devices in BigFix.

When running:
query?relevance=(values of results from ( bes properties “IP Address”) of it) of bes computers

We do get all the devices IP’s from BigFix

image

When running the following Query:
query?relevance=(ids of it, values of results from ( bes properties “Relay Server 2”) of it,values of results from ( bes properties “Relay Name of Client”) of it) of bes computers

We are only getting about 4780 Devices information back.

image

The query I want to run is but it only returns 523 Devices:
query?relevance=(ids of it, name of it, operating system of it, last report time of it,agent type of it,agent version of it, cpu of it, device type of it,license type of it,locked flag of it,relay hostname of it,relay selection method of it,relay server flag of it,relay server of it,root server of it, values of results from ( bes properties “IP Address” ) of it,values of results from ( bes properties “Subnet Address” ) of it,values of results from ( bes properties “RAM”) of it ,values of results from ( bes properties “User Name”) of it,values of results from ( bes properties “Free Space on System Drive”) of it,values of results from ( bes properties “Total Size of System Drive”) of it, values of results from ( bes properties “Environment”) of it, values of results from ( bes properties “Relay Server 1”) of it, values of results from ( bes properties “Relay Server 2”) of it,values of results from ( bes properties “Relay Name of Client”) of it) of bes computers

How do I retrieve all Devices info even if the property is not set?

When you get into querying Computer Properties at scale, there are several things that can impact you:

  • When querying for a plural property value, any computer missing a result will “fall out” of the entire query result
  • When querying for a singular property value, any computer missing a result will throw an error and abort the entire query.
  • When looking up multiple properties on multiple computers, performance can decrease dramatically depending upon how the query is formed, especially if “each computer” triggers a lookup of “every property”, based on how the clauses are formed.

The go-to reference on handling all of these cases is the posting from @brolly33 at Efficient Session Relevance Query for Computer Properties which lays out all of these cases and gives a template for querying multiple computer properties at large scale.

4 Likes

I do something like

(if exists result (it, bes property “Uptime - Windows”)

for analysis properties that may or may not exist

Hi Jason.

I tried the following and it kept complaining about a " I also tried using %22 and still the same.

query?relevance=(name of item 0 of it | “Missing Name”, (concatenation “;” of values of results (item 0 of it,elements of item 1 of it))) of (elements of item 0 of it, item 1 of it) of (set of bes computers, set of bes properties whose (name of it as lowercase = (“Computer Name”) as lowercase))

It gave the following error:

A string constant had no ending quotation mark.

Nervermind for some reason Postman did not understand “;”. I used %22%3B%22 instead.
and it is working now.

1 Like

Thanks a lot for the help

Query is the following and it works:

(
(concatenation %22%3B%22 of values of results (item 0 of it, elements of item 1 of it))
, (concatenation %22%3B%22 of values of results (item 0 of it, elements of item 2 of it))
, (concatenation %22%3B%22 of values of results (item 0 of it, elements of item 3 of it))
, (concatenation %22%3B%22 of values of results (item 0 of it, elements of item 4 of it))
, (concatenation %22%3B%22 of values of results (item 0 of it, elements of item 5 of it))
, (concatenation %22%3B%22 of values of results (item 0 of it, elements of item 6 of it))
, (concatenation %22%3B%22 of values of results (item 0 of it, elements of item 7 of it))
, (concatenation %22%3B%22 of values of results (item 0 of it, elements of item 8 of it))
, (concatenation %22%3B%22 of values of results (item 0 of it, elements of item 9 of it))
, (concatenation %22%3B%22 of values of results (item 0 of it, elements of item 10 of it))
, (concatenation %22%3B%22 of values of results (item 0 of it, elements of item 11 of it))
, (concatenation %22%3B%22 of values of results (item 0 of it, elements of item 12 of it))
, (concatenation %22%3B%22 of values of results (item 0 of it, elements of item 13 of it))
, (concatenation %22%3B%22 of values of results (item 0 of it, elements of item 14 of it))
, (concatenation %22%3B%22 of values of results (item 0 of it, elements of item 15 of it))
, (concatenation %22%3B%22 of values of results (item 0 of it, elements of item 16 of it))
, (concatenation %22%3B%22 of values of results (item 0 of it, elements of item 17 of it))
, (concatenation %22%3B%22 of values of results (item 0 of it, elements of item 18 of it))
, (concatenation %22%3B%22 of values of results (item 0 of it, elements of item 19 of it))
, (concatenation %22%3B%22 of values of results (item 0 of it, elements of item 20 of it))
, (concatenation %22%3B%22 of values of results (item 0 of it, elements of item 21 of it))
, (concatenation %22%3B%22 of values of results (item 0 of it, elements of item 22 of it))
, (concatenation %22%3B%22 of values of results (item 0 of it, elements of item 23 of it))
) of (
elements of item 0 of it
,item 1 of it
,item 2 of it
,item 3 of it
,item 4 of it
,item 5 of it
,item 6 of it
,item 7 of it
,item 8 of it
,item 9 of it
,item 10 of it
,item 11 of it
,item 12 of it
,item 13 of it
,item 14 of it
,item 15 of it
,item 16 of it
,item 17 of it
,item 18 of it
,item 19 of it
,item 20 of it
,item 21 of it
,item 22 of it
,item 23 of it
) of (
set of bes computers
, set of bes properties whose (name of it as lowercase = (“ID”) as lowercase)
, set of bes properties whose (name of it as lowercase = (“Computer Name”) as lowercase)
, set of bes properties whose (name of it as lowercase = (“OS”) as lowercase)
, set of bes properties whose (name of it as lowercase = (“Last Report Time”) as lowercase)
, set of bes properties whose (name of it as lowercase = (“Agent Type”) as lowercase)
, set of bes properties whose (name of it as lowercase = (“agent version”) as lowercase)
, set of bes properties whose (name of it as lowercase = (“CPU”) as lowercase)
, set of bes properties whose (name of it as lowercase = (“Device Type”) as lowercase)
, set of bes properties whose (name of it as lowercase = (“License Type”) as lowercase)
, set of bes properties whose (name of it as lowercase = (“locked”) as lowercase)
, set of bes properties whose (name of it as lowercase = (“Relay”) as lowercase)
, set of bes properties whose (name of it as lowercase = (“BES Relay Selection Method”) as lowercase)
, set of bes properties whose (name of it as lowercase = (“BES Root Server”) as lowercase)
, set of bes properties whose (name of it as lowercase = (“IP Address”) as lowercase)
, set of bes properties whose (name of it as lowercase = (“Subnet Address”) as lowercase)
, set of bes properties whose (name of it as lowercase = (“RAM”) as lowercase)
, set of bes properties whose (name of it as lowercase = (“User Name”) as lowercase)
, set of bes properties whose (name of it as lowercase = (“Free Space on System Drive”) as lowercase)
, set of bes properties whose (name of it as lowercase = (“Total Size of System Drive”) as lowercase)
, set of bes properties whose (name of it as lowercase = (“Environment”) as lowercase)
, set of bes properties whose (name of it as lowercase = (“Relay Server 1”) as lowercase)
, set of bes properties whose (name of it as lowercase = (“Relay Server 2”) as lowercase)
, set of bes properties whose (name of it as lowercase = (“Relay Name of Client”) as lowercase)
)

2 Likes