Monday, August 19, 2013

Nagios Log File Time Conversion [Human Readable]

To tail the file online:
tail -f /var/log/nagios3/nagios.log | perl -pe 's/(\d+)/localtime($1)/e'
To convert certain time stamp:
echo 1376930831 | perl -pe 's/(\d+)/localtime($1)/e'
Mon Aug 19 19:47:11 2013

No comments:

Post a Comment