Relevance on custom property contains

I have a custom analysis tracking what files I have in a custom share on the relay.

(
ids of it , names of it , 
values of results from (bes property "Site" ) of it ,
values whose (it = "office" ) of results from ( bes property "Relay Type" ) of it
)
of bes computers
whose (value of results (bes property "Utility Folder", it) contains "/myfile.zip")

I know I have values of that file associated to machines, but it’s not coming back. know where I may be going wrong?

The string you are searching for suggests a non Windows relay. Most files from a Windows relay will use the '\' character in a path

this is a linux relay

maybe simplify it a bit more. From the “BES Relay Cache” analysis.

(ids of it , names of it )
of bes computers
whose (value of results (bes property "Download Files", it) contains "0bd4dbc08f37f3271aaeec566ab21cc9359b3bd9")

Conceptually I want to pull back the machines that have THAT file in the property on the relay.

You say this is in an Analysis? You’re referencing the “bes property” Inspector, which is part of Session Relevance. Session Relevance isn’t available at the client so it should report an error if used in an Analysis.

You could use “bes property” in a Dashboard or a Web Report, because those are evaluated at the server and have a Session context.

This is for session relevance, not client relevance. I want to know who has what files. The analysis is already out there. Just trying to report on it.

Ok, copy that thanks for the clarification.

One problem I’ve seen, is when reporting on multiple properties, if any of them are empty or not set then you get no result at all. I’ve even seen some clients that hadn’t yet reported a “computer name” property so they get excluded from results or throw an error. So I check for existence of everything -

(
 (if exists id of it then id of it as string else "<no id>"), 
 (if exists name of it then name of it else "<no name>") , 
(if exists values of results from (bes property "Site" ) of it then values of results from (bes property "Site" ) of it else "<no site>"),
/* did you want *only* office type relays?  If not, then check existence on that value too */
values whose (it = "office" ) of results from ( bes property "Relay Type" ) of it
)
of bes computers
whose (value of results (bes property "Utility Folder", it) contains "/myfile.zip")

Good Start, but the “whose(…)” part is still messing with me. I think because there are multiple files like below, it’s not coming back right with that style of “value of results…” in the whose.

so here’s my question. How to I who “contains” and then reversely “does not contain” a file in a result set like below.

So you don’t want a list of all the results, you just want a list of the computers where ‘/myfile.zip’ exists? Try something like

bes computers whose (exists values whose (it as string contains "/myfile.zip") of results (bes property "Utility Folder", it))

OK, much much closer. However if I switch “contains” to “does not contain” , I get the same exact results. not sure how that works.

never mind. thought of a different approach after I hit send.

has it:

bes computers whose (exists values whose (it as string contains "/myfile.zip") of results (bes property "Utility Folder", it))

Doesn’t have it:

bes computers whose (not( exists values whose (it as string contains "/myfile.zip") of results (bes property "Utility Folder", it)))

Thanks!

1 Like

Glad to hear it!

As for switching “contains” versus “does not contain”…both clauses will be true for the systems that have both a match, and files that don’t match.

I.E. if your client has two files in the directory -
/myfile.zip
/notmyfile.zip
then it will match “contains” with the “/myfile.zip” file, and it will match “does not contain” with the “/notmyfile.zip” result.

Your new relevance looks good to me.

1 Like