Print last starting entries found in all available log files
There are two kinds of magic: black and white. Take one spell:
- Gandalf's formulae use white magic of
awk
orperl
- Saruman's formulae use black magic trickily blending
grep
,sed
,awk
,tac
andsort
Description
- process files
FILE_PATTERN
- select the lines matching
START_PATTERN
- from found in 2 take the last entries per every file
- from found in 3 take the entries for
DAYS_AGO
and later - print everything found in 4
Usage
- put it somewhere in the system
- adjust it according your requirements (at least, set
DAYS_AGO
, and possiblyFILE_PATTERN
) - set the execution privilege
- run it
The test log files are provided.