I am trying to search a value from .cfg file. The problem is that on each machine the file is located in different location. so here is what I have and what I am looking for.
File location is C:\ProgramData\Druva\inSync4\users…\insync.cfg (… ) is the user on that machine
I am searching : SERVERS = [’’
Basically I am looking if the file name inSync.cfg inside the C:\Programdata… has SERVERS = ['govcloud.druva.com:443'] than make those machines as relevant.
Here is the relevancy I am trying
search files whose (name of it as lowercase contains "inSync.cfg" AND exists line whose (it as lowercase contains "SERVERS = ['govcloud.druva.com:443']") of it) of folders of folders of folder "C:\ProgramData\Druva\inSync4\users\"
Try each of these in the debugger and let us know how it works…
Listing the files: q: files "insync.cfg" of folders of folders "C:\ProgramData\Druva\inSync4\users"
Find files containing the string
q: files "insync.cfg" whose (content of it contains "govcloud.druva.com:443") of folders of folders "C:\ProgramData\Druva\inSync4\users"
See if any exist: q: exists files "insync.cfg" whose (content of it contains "govcloud.druva.com:443") of folders of folders "C:\ProgramData\Druva\inSync4\users"
file is located inside C:\ProgramData\Druva\inSync4\users\nick or depending on the username such as mark, james. I have created the fixlet using these irrelevancies and will see once the machines start reporting… thank you for such a quick response.
I have another question and lets say I want to reverse this relevancy that It check the file does not have that entry ? Also how can I exclude a user security group , Lets say group name is “test-users” ?
That depends on a few things. Do you want it to be relevant if NO insync.cfg file exists with that entry, or do you want it to be relevant if ANY insync.cfg file exists without that entry?
You didn’t really answer my question. There are 2 different ways to go about this.
This will be true if the file doesn’t exist at all, or if all of the insync.cfg files do not have govcloud.druva.com:443 within them:
not exists files "insync.cfg" whose (content of it contains "govcloud.druva.com:443") of folders of folders "C:\ProgramData\Druva\inSync4\users"
This may not be what you want though, it sounds like what you are aiming for is if any insync.cfg without that entry, which would be different relevance.
The challenging part here is really when there are multiple insync.cfg files for multiple users on the same system. If a particular system only ever has at most one insync.cfg file, then this is much more straightforward.