Relevance call difference between root servers

I have a query that I need to run on 2 different root servers but use the same relevance. Problem I’m running into is getting the computer name back. I used the excel plugin to create the query and it tacked on some extra stuff for the computer name, but that info doesn’t come back on the 2nd root server.

(	item 0 of it as string  & "|" & 
item 1 of it as string  & "|" & 
(if ((year of date (local time zone) of it) as integer = 1980) 
	then ("<none>") 
	else (
		(year of it as string & "/" & 
		 month of it as two digits & "/" & 
		 day_of_month of it as two digits) of date (local time zone) of it & " " & 
		(two digit hour of it as string & ":" & 
		 two digit minute of it as string) of time (local time zone) of it)) 
			of (item 2 of it as time)) 
of (
	(if (exists result (item 0 of it, item 1 of it) and 
		 exists values of result (item 0 of it, item 1 of it) ) 
		then (concatenation "%0A" of values of result (item 0 of it, item 1 of it)) 
		else ("<none>")), 
	(if (exists result (item 0 of it, item 2 of it) and 
		 exists values of result (item 0 of it, item 2 of it) ) 
		then (concatenation "%0A" of values of result (item 0 of it, item 2 of it)) 
		else ("<none>")), 
	(if (exists result (item 0 of it, item 3 of it) and 
		 exists values of result (item 0 of it, item 3 of it) ) 
		then (concatenation "%0A" of values of result (item 0 of it, item 3 of it)) 
		else ("<none>")))  
of (
	elements of intersection of (
		(sets of items 0 
			of (computers of it, values whose (it as lowercase = "002324658399") of it) 
				of results of bes property "KR_Imaging-MacAddress"); 
		(sets of items 0 
			of (computers of it, values whose (it as lowercase = "mj00e1af") of it) 
				of results of bes property "KR_Imaging-SerialNumber")),
	bes property "ID",
	bes property "Computer Name" and 
		(item 0 of it = 2299705214 and item 1 of it = 4 and item 2 of it = 1) of id of it),
	bes property "Last Report Time")

I would hope/thing the extra “and (item 0 of it = 2299705214 and item 1 of it = 4 and item 2 of it = 1) of id of it)” could not be necessary, but it is. I ran the excel plugin on the 2nd root server and it gave new numbers in that query.

How do I make this query platform agnostic? I actually ran across this on another one of my calls I think after our patch 10 upgrade where I was only calling for bes property “Computer Name” and the query came back with "<none>" for it.

Much appreciate the help!

1 Like

I get results from the “Computer Name” property…

values of results of bes properties "Computer Name"

but your mileage may vary if that property name happens to be duplicated (in an Analysis, for instance). I think I recall a discussion in which checking bes properties "Computer Name" only returns the first one that it finds, and not the duplicate properties.

You could try this to see whether there’s a duplicate…

(name of it, (if exists (source analysis of it) then (name of source analysis of it & " - "& name of site of source analysis of it) else "Global")) of bes properties whose (name of it as lowercase = "computer name")

1 Like

We found the problem. An analysis with a duplicate “Computer Name” property was in imported. :face_with_symbols_over_mouth:

1 Like

One approach I take in such cases to avoid issues with duplicate properties (aside from specifying the property by ID) is to leverage ‘reserved flag’. This works well with properties such as Computer Name, with something like:

values of results of bes property whose (reserved flag of it AND name of it = "Computer Name")
3 Likes