Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: RSyslog: users

Timestamp formatting

 

 

RSyslog users RSS feed   Index | Next | Previous | View Threaded


xuan_zhong at hotmail

Jan 24, 2012, 12:39 PM

Post #1 of 4 (208 views)
Permalink
Timestamp formatting

Hi,
I am using rfc3339 to format the timestamp and get the following in the log:
2012-01-24T21:36:11.860808+01:00

Does anyone know if there is a way to change the template to display only part of the Timestamp: 2012-01-24T21:36:11.8608 which is fixed length string and replace T with a white space?

Thanks
Xuan


_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/


rgerhards at hq

Jan 24, 2012, 12:59 PM

Post #2 of 4 (204 views)
Permalink
Re: Timestamp formatting [In reply to]

Search for the property replacer, you can set the start and endposition oft
he string. Yoou need to extract the date, then put a SP into the template,
than extract the time part

rg

> -----Original Message-----
> From: rsyslog-bounces [at] lists [mailto:rsyslog-
> bounces [at] lists] On Behalf Of Xuan Zhong
> Sent: Tuesday, January 24, 2012 9:40 PM
> To: rsyslog [at] lists
> Subject: [rsyslog] Timestamp formatting
>
>
>
> Hi,
> I am using rfc3339 to format the timestamp and get the following in the
> log:
> 2012-01-24T21:36:11.860808+01:00
>
> Does anyone know if there is a way to change the template to display
> only part of the Timestamp: 2012-01-24T21:36:11.8608 which is fixed
> length string and replace T with a white space?
>
> Thanks
> Xuan
>
>
> _______________________________________________
> rsyslog mailing list
> http://lists.adiscon.net/mailman/listinfo/rsyslog
> http://www.rsyslog.com/professional-services/
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/


xuan_zhong at hotmail

Jan 25, 2012, 6:37 PM

Post #3 of 4 (206 views)
Permalink
Re: Timestamp formatting [In reply to]

Hi,

I subscribed to the mailer list but didn't receive the email. I saw other people responded my previous email in the http archives link.
I tried to extract the date part using the start and end position of the string, it didn't work.
Here is my timestamp template: %TIMESTAMP:::date-rfc3339%
I tried to extract the substring position from 1 to 24, %TIMESTAMP:::date-rfc3339:1:24%, which gave me a totally different formatted timestamp.
Any idea which part is wrong? I tried to use that to extract part of msg text, it did work, like %msg:1:24% gave me first 24 characters.

Thanks
Xuan


Search for the property replacer, you can set the start and endposition oft
he string. Yoou need to extract the date, then put a SP into the template,
than extract the time part

rg

From: xuan_zhong [at] hotmail
To: rsyslog [at] lists
Subject: Timestamp formatting
Date: Tue, 24 Jan 2012 20:39:37 +0000








Hi,
I am using rfc3339 to format the timestamp and get the following in the log:
2012-01-24T21:36:11.860808+01:00

Does anyone know if there is a way to change the template to display only part of the Timestamp: 2012-01-24T21:36:11.8608 which is fixed length string and replace T with a white space?

Thanks
Xuan


_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/


rgerhards at hq

Jan 25, 2012, 10:21 PM

Post #4 of 4 (204 views)
Permalink
Re: Timestamp formatting [In reply to]

%TIMESTAMP:1:24:date-rfc3339%,

> -----Original Message-----
> From: rsyslog-bounces [at] lists [mailto:rsyslog-
> bounces [at] lists] On Behalf Of Xuan Zhong
> Sent: Thursday, January 26, 2012 3:38 AM
> To: rsyslog [at] lists
> Subject: Re: [rsyslog] Timestamp formatting
>
>
> Hi,
>
> I subscribed to the mailer list but didn't receive the email. I saw
> other people responded my previous email in the http archives link.
> I tried to extract the date part using the start and end position of
> the string, it didn't work.
> Here is my timestamp template: %TIMESTAMP:::date-rfc3339%
> I tried to extract the substring position from 1 to 24,
> %TIMESTAMP:::date-rfc3339:1:24%, which gave me a totally different
> formatted timestamp.
> Any idea which part is wrong? I tried to use that to extract part of
> msg text, it did work, like %msg:1:24% gave me first 24 characters.
>
> Thanks
> Xuan
>
>
> Search for the property replacer, you can set the start and endposition
> oft
> he string. Yoou need to extract the date, then put a SP into the
> template,
> than extract the time part
>
> rg
>
> From: xuan_zhong [at] hotmail
> To: rsyslog [at] lists
> Subject: Timestamp formatting
> Date: Tue, 24 Jan 2012 20:39:37 +0000
>
>
>
>
>
>
>
>
> Hi,
> I am using rfc3339 to format the timestamp and get the following in the
> log:
> 2012-01-24T21:36:11.860808+01:00
>
> Does anyone know if there is a way to change the template to display
> only part of the Timestamp: 2012-01-24T21:36:11.8608 which is fixed
> length string and replace T with a white space?
>
> Thanks
> Xuan
>
>
> _______________________________________________
> rsyslog mailing list
> http://lists.adiscon.net/mailman/listinfo/rsyslog
> http://www.rsyslog.com/professional-services/
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/

RSyslog users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.