SRX Services Gateway
SRX Services Gateway

sd-syslog timestamp format

‎03-24-2016 07:19 AM

 Hi,

 

I'm struggling with timestamp on sd-syslog message. It seems they are using ISO8601 timestamp format but the timezone indication is missing. I have timestamp like this : 

 

2016-03-24T14:41:24.806

 

But since I'm in GMT+1 timezone, that time is not correctly interpreted by my logging system. According to ISO8601 I should have the possibility to add timezone indication like this

 

2016-03-24T14:41:24.806+01:00 or 2016-03-24T13:41:24.806Z

 

 

Any idea how to achieve this?

 

Best regards,
Christophe

1 REPLY 1
SRX Services Gateway

Re: sd-syslog timestamp format

‎03-24-2016 08:58 AM

AFAIK, If you use the "structured-data" statement then you will generate messages with the following format (although this example also includes the statement "time-format millisecond".

 

2016-03-22T09:44:49.360-07:00

 

e.g.

file default-log-messages {
    any info;
    match "(requested 'commit' operation)|(copying configuration to juniper.save)|(commit complete)|ifAdminStatus|(FRU power)|(FRU removal)|(FRU insertion)|(link UP)|transitioned|Transferred|transfer-file|(license add)|(license delete)|(package -X update)|(package -X delete) | CFMD_CCM_DEFECT| LFMD_3AH | RPD_MPLS_PATH_BFD|(Master Unchanged, Members Changed)|(Master Changed, Members Changed)|(Master Detected, Members Changed)|(vc add)|(vc delete)|(Master detected)|(Master changed)|(Backup detected)|(Backup changed)|(interface vcp-) | (AIS_DATA_AVAILABLE)";
    structured-data;
}
time-format millisecond;

 

> show log default-log-messages
<30>1 2016-03-22T09:44:49.360-07:00 xxx-xxxx-xxxx mib2d 3202 SNMP_TRAP_LINK_UP [junos@2636.1.1.1.2.21 snmp-interface-index="506" admin-status="up(1)" operational-status="up(1)" interface-name="lsi.0"] ifIndex 506, ifAdminStatus up(1), ifOperStatus up(1), ifName lsi.0

HTH,

Regards,

Andy