I have the following relevance that returns the values from /etc/passwd to get users on systems:
(name of computer of it,values of it) of results from (bes properties whose (name of it = “Linux passwd”)) of members of bes computer groups whose (name of it = “Linux”)
I’m trying to be able to filter the results to only match values that contain a certain user, for example ‘mlynch’ I’ve seen a couple of different posts on using “whose value as lowercase contains ‘xyz’” but can’t seem to get that in the right position to get the relevance to work.
We have a webreport that does exactly what I want, but I need this session relevance for some scripting/automation.
I’ve been trying to get this to return any results, but still nothing:
Q: number of bes computers whose( ( (value of results from ( bes property “Linux passwd”) of it) contains “root”) of members of bes computer groups whose (name of it = “Linux”))
A: 0
The answer should be 6, as all 6 boxes have root and are in the “Linux” group.
The trick for the Whose clause in Relevance is to put it right after an Object that you want to work with.
So if you want to filter based on the values returned from the property results, you can do it this way:
(name of computer of it,values whose (it as lowercase contains "xyz") of it) of results from (bes properties
whose (name of it = "Linux passwd")) of members of bes computer groups
whose (name of it = "Linux")
If you go after the Results object, then here is another example:
(name of computer of it,values of it) of results from (bes properties
whose (name of it = "Linux passwd")) whose (value of it as lowercase contains "xyz") of members of bes computer groups
whose (name of it = "Linux")