This topic describes how to use CLI commands to specify the syslog timestamp format. For a full list of logging commands and the usage and parameters, see the CLI Command Reference.
Admin access
Go to CLI configuration mode:
hostname > enable hostname # configure terminal
Enter the
logging fields timestamp format <format>command, where<format>is one of the following:rfc-3164—Use the timestamp format specified in RFC-3164 (for example, May 13 15:12:01).
rfc-3339—Use the timestamp format specified in RFC-3339 (for example, 2017-05-15T15:22:33).
The following example specifies that all log messages use RFC-3339 format:
hostname (config) # logging fields timestamp format rfc-3339
Verify your changes:
hostname (config) # show logging Local logging level: err Remote syslog default level: notice No remote syslog servers configured. Receive remote messages via UDP: no Receive remote messages via TCP: no Receive remote messages via TLS: no Log file rotation: Log rotation size threshold: 256 megabytes Archived log files to keep: 40 Log format: Timestamp format: rfc-3339 Subsecond timestamp field: disabled Secure channel logs: no
Save your changes.
hostname (config) # write memory