How to search for a list of strings saved in a file and then search against log files
Posted 02-20-2009 at 01:10 PM by unixuser
Want unix script to search a list of strings (stored line by line in a file), search all the matching lines of files under directories and subdirectories in different unix machines(not one box diff boxes - all the unix box names and username/password are stored with a comma delimitor in flat file) and piped to a file. THE SEARCH SHOULD BE FAST.
Scenario:
1) searchlist.txt will have like
id1
id2
id3
id4 etc....
2) and the id's should be searched in files under the folder /logs and again /logs might have subdirectories in it. the /logs even might have .gz files also. the id's should be searched even in .gz files also. if any line matches the lines should be piped to result.txt file. the script should be capable of searching in differenct unix boxes.
3) THE SEARCH SHOULD BE VERY FAST as the log files under /logs directory will be in 100's and huge too.......
Early reples will be appreciated.
Scenario:
1) searchlist.txt will have like
id1
id2
id3
id4 etc....
2) and the id's should be searched in files under the folder /logs and again /logs might have subdirectories in it. the /logs even might have .gz files also. the id's should be searched even in .gz files also. if any line matches the lines should be piped to result.txt file. the script should be capable of searching in differenct unix boxes.
3) THE SEARCH SHOULD BE VERY FAST as the log files under /logs directory will be in 100's and huge too.......
Early reples will be appreciated.
Total Comments 0