Anyone know how to get the "First x" elements of something?

Our CMDB group is asking for the last 15 users to log into all of our servers. I can generate the list of users who have logged into the computers, but some of the servers (Citrix) have had hundreds of users log into them over time.

Anyone have a magic relevance clause that can return the first 15 objects in a set?

tuple string items (integers in (1, 15)) of concatenation ", " of elements of set of [however you retrieve it]

(this doesn’t take into account “last 15 users” (by most recent logon), as “set of” will sort alphabetically)

You can get it creatively by using https://developer.bigfix.com/relevance/reference/tuple-item.html#index-of-tuple-item-integer which was added in 9.5.3

Take the multiple results and turn it into a tuple and then use whose (index of it < 15) to get the values.

I’m sure @jgstew can come up with something concrete but this is why I made the inspector :slight_smile:

1 Like

The new Relevance object is MUCH appreciated!

Now I just need to figure out how to do this “cross-platform” (Windows, Linux, Mac, Solaris, etc) so that I get consistent results. But this gets me a lot farther along than I was when I posted the question!