Group Relevance - files with wildcard?

(imported topic written by mcharves)

I’m attempting to create a computer group where the relevance seeks for two specific files on the system. The problem I’m running into however is how to create a relevance that - essentially - searches with “contains” rather than “equals,” because the files in question are created with the machine name affixed to the beginning. For example:

COMPUTER11_SFXPreinstall.log

I need the group relevancy to seek only the “_SFXPreinstall.log” section of the file.

I tried something like “exists file (contains “_SFXPreinstall.log”)” but that tells me it has a syntax error. Admittedly I’m somewhat new to the relevance language.

(imported comment written by jeremylam)

What you want to check is the file name of the file object - there are many properties of a file and the name is just one of them.

q: exists file whose (name of it contains “_SFXPreinstall.log”) of folders “C:”

(of course you’d want to change what folder is being searched)

There are regex inspectors in the relevance language but if you’re just checking for a substring, “contains” works just fine.

(imported comment written by mcharves)

Okay, that worked great - thank you!

I have another question then… if I wanted to attempt to seek for something within a LOG or TXT file, what would be the process for that? For example, if I needed to search for the file above “SFXPreinstall.log” and find “Installation Completed Successfully” within it? Is that possible?

(imported comment written by jgstew)

This is a tad more specific for success:

exists files whose(name of it ends with “SFXPreinstall.log” AND exists lines whose(it contains “Installation Completed Successfully”) of it) of folders “C:”

The nice thing about the above, is that you can detect failure just by adding a “NOT” in front:

not exists files whose(name of it ends with “SFXPreinstall.log” AND exists lines whose(it contains “Installation Completed Successfully”) of it) of folders “C:”

(imported comment written by gearoid)

Yea - you sure can get at the contents of the file and “inspect” it. Have a look that properties of the file type using.

Q: properties of type “file”

A: aol error of …

A: lines containing of : file line …

You might try the
lines containing of
property which will return true if there’s a line containing your string.

Q: exists lines containing “Installation Completed Successfully” of file whose (name of it contains “_SFXPreinstall.log”) of folders “C:”

A: True