nagios.logのtai64nlocale変換
nagios.logは以下のように、ログの時刻formatがtai64nlocaleになってる。
通常はtail64nlocale
コマンドを通せば整形されるが、[]で囲まれてるので正常に変換されない。
nagios.log
[1396426834] Caught SIGHUP, restarting...
[1396426834] Nagios 3.2.0 starting... (PID=8813)
[1396426834] Local time is Wed Apr 02 17:20:34 JST 2014
[1396426834] LOG VERSION: 2.0
なのでperlワンライナーを以下の通りにやって日付を表示させると良い
nagios.log
perl -pe 's/(\d+)/localtime($1)/e' nagios.log
[Wed Apr 2 17:20:34 2014] Caught SIGHUP, restarting...
[Wed Apr 2 17:20:34 2014] Nagios 3.2.0 starting... (PID=8813)
[Wed Apr 2 17:20:34 2014] Local time is Wed Apr 02 17:20:34 JST 2014
[Wed Apr 2 17:20:34 2014] LOG VERSION: 2.0
Author And Source
この問題について(nagios.logのtai64nlocale変換), 我々は、より多くの情報をここで見つけました https://qiita.com/shivase/items/b4250e3e5ea54b247e45著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .