0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

rsyslogでログのタイムスタンプの変更

Last updated at Posted at 2019-10-22

ログのタイムスタンプをyyyy-mm-dd HH:MM:SS形式に変更する。

/etc/rsyslog.confに下記の設定を記載。

# 2017-12-15 19:17:01 854150 cron info CRON[12235]:  (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
$template template_name, "%timestamp:::date-year%-%timestamp:::date-month%-%timestamp:::date-day% %timestamp:::date-hour%:%timestamp:::date-minute%:%timestamp:::date-second% %timestamp:::date-subseconds% %syslogfacility-text% %syslogseverity-text% %syslogtag% %msg:::drop-last-lf%\n"

*.*;          -/var/log/syslog;template_name

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?