Hello everyone I was wondering if someone could please give an example point me in the right direction on how I would go about scripting a search script using bash, I am new to Linux and scripting, I can do basic bash scripts and just need some example to start from as what I have tried so far does not work.
I have log directories in the following format and would like to search the logs for specific information looping through several days.
/log/device/2007/05/02..then about 5 different log files in each "day" directory which I would like to grep for certain data.
What I would like to do is start searching at the "month" directory then have the script loop through the each one of the "day" folders.
Here is one example I often have to search the logs spanning five or six day and have to manually cd into each directory and do a search for and IP, like so grep 10.10.10.1 *
So what I would like to be able to do is grep/run the script for 10.10.10.1 but over a span XX days. Not sure if I should use find or grep or another command to search the log files.
thanks for all the help in advance