Relevance issues

i want to make an analysis to find a file that contains a string let say “abc123”.

i make a relevance to gather all the txt file
pathnames of find files “*.txt” of (descendant folders of folder “c:”)

but if i include contains clause it gives an error.
pathnames of find files “*.txt” contains “abc123” of(descendant folders of folder “c:”)

please help me in making it dynamic that it can find all the files that contains"abc123" irrespective of any extensions.

Thanks in advance

This is very, very likely to break your machine. I have to ask for what purpose you would want to do a content search such as this?

Consider that every time this relevance executes, it is going to read the entire content of every file on the hard drive (once you add logic to skip locked files).

How frequently the Relevance executes depends on the context - Fixlet/Task relevance, Analysis Result, or Action Script Substitution - but I do not believe there is any case where this will do what you ask.

Agree with Jason… but if you want to hold the gun to your head…

files whose ( content of it contains "abc123" ) of descendant folders of folders "C:\"

yes totally agree with Jason, i had a query from my client is there any way to check for some files on very few systems, so therefore i’m testing in this way.

Please suggest me what is the best way to achieve this. (on 5 to 10 systems).

Either i make a custom action or make an analysis and activate on the desired systems ?

@masonje it doesn’t display a .docx file. i place the same content which i placed in a .txt file and it shows only a .txt files.

That’s a tough one. All of MS Office .___x file formats are more or less zip files with xml content in them. I don’t know of a good way to look for all those and pull out the content. Sounds like something you need to script out.

Might be able to do something cool with 7zip to extract the file content and search it that way. I would not anticipate it be possible in pure relevance. but #n00b

1 Like

I don’t think this is something that would be doable directly through Relevance.

You would have to write a Task to first FIND all the .DOCX files and make a list of them. Then parse through the list, unpacking each one and searching it for your string, appending the file path and name to a text file for later pickup by an Analysis. Then cleanup the last “unpacked file” and repeat the process until you have examined all the files in the list.

This would be a complex task, and would likely cause some grief for any user on the targeted computer. It also might not work properly if you tried to do this to a .DOCX file that was open and locked by Word at the time of the scan.

1 Like

For system-wide content harvesting, I’d really look at a targeted product like Identity Finder.

1 Like
1 Like

The only way to do what you are asking is by using an action to run a script or software that will do this for you or by using BigFix to manage another agent -> server program.

Identity Finder is one that is both something you could run an on-demand scan using BigFix, as well as something you can manage an ongoing agent -> server relationship with BigFix. There are already analyses on for auditing Identity Finder.

You can look for text within a set of files using relevance, but you should definitely not do this to search all files. It will not work and it will cause the client to timeout running the relevance. It will also put unusually heavy load on the client and make it slow to process new relevance.

See related posts: