To filter it down to a particular computer group, you can use sets. In order to get what’s going on here, you should make sure you have an understanding of sets and tuples. In the two cases that we’re returning numbers of computers, we will use the intersection of two sets to filter the number down. We can already easily get the applicable computer set
of the fixlets in the baseline by changing applicable computer count of it
to applicable computer set of it
. We can also get the set of computers from the fixlet results by changing number of results whose (remediated flag of it = true) of it)
to set of computers of results whose (remediated flag of it = true) of it)
.
That gives us:
(name of it, source severity of it | "Unspecified", source release date of it as string | "NA", applicable computer set of it, set of computers of results whose (remediated flag of it = true) of it) of source fixlets of components of component groups of bes baselines whose (name of it = "MYCOOLBASELINE")
Now we need to introduce the set of members of a particular group. You can get that by doing:
member set of bes computer group whose (name of it = "MYCOOLGROUP")
.
If we introduce it as item 5 of the tuple we created above, we get:
(name of it, source severity of it | "Unspecified", source release date of it as string | "NA", applicable computer set of it, set of computers of results whose (remediated flag of it = true) of it, member set of bes computer group whose (name of it = "MYCOOLGROUP")) of source fixlets of components of component groups of bes baselines whose (name of it = "MYCOOLBASELINE")
All that’s left now is to actually do the comparison. You can compare two sets to each other by doing intersection of (set1; set 2)
. We’re going to do that twice in our query, and then finish it off by counting the elements of the intersection of the set:
(item 0 of it, item 1 of it, item 2 of it, number of elements of intersection of (item 3 of it; item 5 of it), number of elements of intersection of (item 4 of it; item 5 of it)) of (name of it, source severity of it | "Unspecified", source release date of it as string | "NA", applicable computer set of it, set of computers of results whose (remediated flag of it = true) of it, member set of bes computer group whose (name of it = "MYCOOLGROUP")) of source fixlets of components of component groups of bes baselines whose (name of it = "MYCOOLBASELINE")
Let me know if I can explain any of this. The session relevance documentation at https://developer.bigfix.com/relevance/guide/session/ is invaluable.