Yes, I understand now.
The date stamp format for the log files is controlled rsyslogd, the message logging daemon. You'd need to create a new template with your preferred date format and restart rsyslogd.
See:
http://www.rsyslog.com/doc/v8-stable/co ... lates.html but keep in mind that this is the documentation for v8 while efa/centos 6 is using version 5.8.10, so not all the examples may apply.
More useful information can be found here:
https://unix.stackexchange.com/question ... y-rsyslogd
Now, since you brought it to my attention, and reading the above links takes a fair bit of work, here is something you can add to /etc/rsyslog.conf to give you useful timestamps in YY-MM-DD HH:MM:SS format (the most useful format for human readable date formats in my not so humble opinion)
Code: Select all
#### GLOBAL DIRECTIVES ####
$template CustomFormat,"%TIMESTAMP:1:10:date-rfc3339% %TIMESTAMP:12:19:date-rfc3339% %HOSTNAME% %syslogtag%%msg%\n"
# Use default timestamp format
#$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
$ActionFileDefaultTemplate CustomFormat
That shitty looking syntax can be broken down into the following
%TIMESTAMP% = the date format, which looks like "2017-07-24T12:30:50.373801+08:00"
%TIMESTAMP:1:10:date-rfc3339% means grab the characters 1 - 10
%TIMESTAMP:12:19:date-rfc3339% menas grab characters 12 - 19
Thus my final timestamp pulls out two substrings from the timestamp string
2017-07-24T
12:30:50.373801+08:00
and that's good enough for me.
If you want American date formats, you can slice and dice your string until you have the format you want.
Also, I've specified the rfc3339 date format which includes high precision time and timezone, but only because that was the full date example that I quickly found in the documentation. There may be other date formats, but I don't have the time to look them up for you.
Have fun!
Edit: went and found the correct documentation anyway:
- https://rsyslog-5-8-6-doc.neocities.org ... lates.html
- https://rsyslog-5-8-6-doc.neocities.org ... lacer.html <-- the key bit