Linux command for finding a particular word and finding its number of occurrences for a particular date -
i have log files roll out every day.
i need find out, error occurrences particular day (20/3/2014
)
i need find out no of occurrences of word error
particular day or set of days in log files , print errors in separate file.
and mail should sent details of errors.
egrep can lookup such occurrences , store them in file. expression below ocurrence of token error , print line token found.
egrep -i "\s*error\s*" your_file > stored_errors_file
you can redirect output of egrep file , count number of ocurrences with
wc -l stored_errors_file
i hope helps
Comments
Post a Comment