Main Page/IT/nagios

From Lewis Consultancy Wiki
< Main Page‎ | IT
Jump to: navigation, search

A one liner to split up a nagios log

cat nagios.log  | while read line; do  unixts=`echo $line | cut -b 2-11`;  logname="nagios-`date -d \@$unixts +%m-%d-%Y`-00.log"; echo $line >> $logname; done