Hello I want to output ERROR messages from logfiles from the current date.
First I search for the logs of today with specific prefix:
find /home/USER/logfilesError/ -maxdepth 1 -type f -name "xy_*" -daystart -mtime -1
It gives me that output:
/home/USER/logfilesError/xy_2071.log /home/USER/logfilesError/xy_2072.log /home/USER/logfilesError/xy_2073.log
In these files I want to search for the string "ERROR":
grep -rl "ERROR" /home/USER/logfilesError/
This gives me all the Logfiles containing "ERROR" not only from today.
Output(only some of the output):
How can I combine those in a script?
The Syntax from a line in the logfiles are:
2013-11-24 06:30:30,549 [main] ERROR *(+Errormessage)*