I want to check all the log files in a particular directory then grep if any of the log files have "STRING1" and "STRING2" string and then have to send email to the group.
The code snippet is just; what i am looking for. It is not a working piece because i am not able to redirect the grep thing into a file.
1) I want to search for both the string "STRING1" and "STRING2". If any of the strings is present in any of the logs immediately it should send an e-mail.
2) There will be approximately 60 log files.
3) Log files will be of size 2 MB approx.
4) Error message depends upon some application failure.
5) Yes, if script is done then I can run it in cron job.