Convert to Local Time

Hello everybody,
I’m a little new to graylog.
I am receiving syslog messages in 2020-08-04 19:15:40 +02:00 format and would like to convert them into my current time zone. Unfortunately I don’t get along well with the Pipeline Ruls.
Can someone help me.

My Pipeline Rule

rule “change_timezone”
when
true
then
set_field(“new_timestamp”, format_date(value: to_date($message.timestamp),format: “dd.MM.yyyy HH:mm:ss”));
end

From Syslog commes
2020-08-04 19:15:40 +02:00
But i want to
04.08.2020 21:15:40

Thanks!
MichaelS

Hello @MichaelS, welcome!

rule “change_timezone”
when
true
then
let new_date = now(“America/Chicago”);
set_field(“timestamp”, new_date);
end

Hello ttsandrew,

wow thats fast and very easy :slight_smile:

thanks!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.