API Query - Issue when endpoint has bad data

I have an API query to get ID, computer name, list of IP, Provider Name, uptime, last report time, etc. The query is:

(id of it, name of it, concatenation “;” of values of results (it, bes property “IP Address”), Operating System of it, (if exists result (it, bes property “Provider Name”) then value of result (it, bes property “Provider Name”) else “none”), value of result (it, bes property “Free Space on System Drive”), (if exists result (it, bes property “Uptime - Windows”) then value of result (it, bes property “Uptime - Windows”) else “none”), Last Report Time of it) of bes computers whose (Agent Type of it contains “Native”)

When developing the query I found that when a endpoint first joins BigFix, analysis properties like “uptime” may not yet be inventoried. When that occurred, my query would stop at that point and only return a partial list of endpoints. I added the “if exist result” to my query and that resolved the issue, so I would get a full list.

I now have this happening again, but for “Provider Name” from the Cloud Providers analysis. However, instead of being null/empty value there, the client is reporting “FileIOError error while copying property (1450).” in the console. I have “if exist result” here but this is not working, as my query is stopping when it gets to this endpoint, and only returning a partial list of endpoints.
image

Questions:

  1. Anyone have a relevance recommendation to solve this?

(if exists result (it, bes property “Provider Name”) then value of result (it, bes property “Provider Name”) else “none”)

  1. I have not attempted to fix the endpoint yet, as this is a great use case to harden my query first. Anyone seen this before, and have feedback on resolving?

I often use pipe “|” to give a different result if the query fails. That usually prevents the failures.
(some query that might not always return | “”, some other query that might fail | “no result”) of bes computers

2 Likes

I’d suggest having a look at the following post as well: Efficient Session Relevance Query for Computer Properties

It goes into a lot of detail, and has some suggested approaches to help with these types of situations, as well as a structure that is very efficient.

3 Likes

That worked. I updated the query to be:

(id of it,
name of it,
concatenation “;” of values of results (it, bes property “IP Address”),
Operating System of it,
value of result (it, bes property “Provider Name”) | “none”,
value of result (it, bes property “Free Space on System Drive”) | “none”,
value of result (it, bes property “Uptime - Windows”) | “none”,
Last Report Time of it)
of bes computers whose (Agent Type of it contains “Native”)

Per Aram’s post… I am sure I could do a bit more here as well.

Another quick tweak… it’s working right now, but I don’t have bad/missing data to confirm all fields:

(id of it,
name of it | “Missing”,
concatenation “;” of values of results (it, bes property “IP Address”) | “Missing”,
Operating System of it | “Missing”,
value of result (it, bes property “Provider Name”) | “Missing”,
value of result (it, bes property “Free Space on System Drive”) | “Missing”,
value of result (it, bes property “Uptime - Windows”) | “Missing”,
Last Report Time of it)
of bes computers whose (Agent Type of it contains “Native”)

1 Like