Finding a file with a variable path

(imported topic written by TimRozycki91)

I need to find and parse a file, but only a part of the path is constant across the computers in our environment. The file I am looking for is serverindex.xml and the constant part of the path is “E:\IBMWebSphere61\AppServer\profile”. Beyond that the path can be different for each box. I am looking for help with the relevance code to find the file and read its contents. Also, I have been told that there will always be multiple serverindex.xml files in different locations on each box. Thanks

(imported comment written by MattBoyd)

You should be able to do this with relevance. I don’t have any experience with WebSphere or the folder structure. Could you provide a few examples of what the complete URL would look like? Is serverindex.xml always under a subfolder of E:\IBMWebSphere61\AppServer\profile ?

Also, could you provide a sample serverindex.xml and what values you would like from it?

(imported comment written by TimRozycki91)

It is always under a subfolder of E:\IBMWebSphere61\AppServer\profiles. Actually I should say they are under subfolders of this folder. The one example I have is E:\IBMWebSphere61\AppServer\profiles\DRILLERA004\config\cells\doccell\nodes\DRILLERA004Node\serverindex.xml. Within that xml file I am looking to get the lines that contain ‘’. That part I can see how to do using ‘lines containing’, I’m just confused about how to find the files in the first place.

(imported comment written by NoahSalzman)

Some posts that should help:

http://forum.bigfix.com/viewtopic.php?id=5162

http://forum.bigfix.com/viewtopic.php?id=4102

(imported comment written by TimRozycki91)

This is close, but the files I am looking for are in paths that can vary in length. Here is the test environment I have set up:

H:\IBMWebSphere61\AppServer\profiles\path1\step1_1\step1_1_1\serverindex.xml

H:\IBMWebSphere61\AppServer\profiles\path1\step1_2\serverindex.xml

H:\IBMWebSphere61\AppServer\profiles\path2\step2_1\serverindex.xml

H:\IBMWebSphere61\AppServer\profiles\path3\

H:\IBMWebSphere61\AppServer\profiles\path4\serverindex.xml

Using the recusion test from the other posts I get this:

q: pathnames of files whose (name of it = “serverindex.xml”) of folders of folders of folders “H:\IBMWebSphere61\AppServer\profiles”

A: H:\IBMWebSphere61\AppServer\profiles\path1\step1_2\serverindex.xml

A: H:\IBMWebSphere61\AppServer\profiles\path2\step2_1\serverindex.xml

I need a recursive search that will go an unknown number of folders deep from a known path part and find an unknown number of files.

Any help with this is greatly appreciated.

(imported comment written by TimRozycki91)

I have found what I am looking for. If this is the test environment I am running my relevance against:

H:\IBMWebSphere61\AppServer\profiles\path1\step1_1\step1_1_1\serverindex.xml

H:\IBMWebSphere61\AppServer\profiles\path1\step1_2\serverindex.xml

H:\IBMWebSphere61\AppServer\profiles\path2\step2_1\serverindex.xml

H:\IBMWebSphere61\AppServer\profiles\path3\not_serverindex.xml

H:\IBMWebSphere61\AppServer\profiles\path4\serverindex.xml

I find the files I want and miss the files I don’t want with this relevance:

q: pathnames of descendants whose (name of it = “serverindex.xml”) of folder “H:\IBMWebSphere61\AppServer\profiles”

A: H:\IBMWebSphere61\AppServer\profiles\path1\step1_1\step1_1_1\serverindex.xml

A: H:\IBMWebSphere61\AppServer\profiles\path1\step1_2\serverindex.xml

A: H:\IBMWebSphere61\AppServer\profiles\path2\step2_1\serverindex.xml

A: H:\IBMWebSphere61\AppServer\profiles\path4\serverindex.xml

Thanks for the help.