Can you change the date format for syslogd?

Wondered if it was possible to get syslogd to include the year in the datetime stamp on log entries so that I can store certain logs in a file for automated processing.

Xserve G5

Posted on Sep 21, 2011 6:19 AM

Reply
1 reply

Sep 28, 2011 8:37 AM in response to Grant Wray

I've posted this in another query of mine regarding keeping a separate bootpd log file. Two birds, one stone.


syslog -u -E safe -k Sender bootpd -k Time ge -24h > DHCPday.log

cat DHCP.log DHCPday.log> DHCPtemp.log

cp DHCPtemp.log DHCP.log


The -u switch on syslog causes it to output the timestamp in UTC, thus it includes the year. By incorporating this script as a cron job, the server is now keeping a growing record of DHCP allocations with a full datetime stamp for later processing.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Can you change the date format for syslogd?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.