Use time same with the host local timezone


(poper) #1

Hi There,

I have read more topics but I don't understand about timezone. So I just need to create the file with the hour in the day. output e.g. 21.log, 22.log, 23.log, 00.log, 01.log

My logstash.conf

file {
path =>"/var/log/%{+HH}.log"
}

But when I use HH it returns 18 looks in my test log below not same my local timezone. I need to use same a local timezone in my host. how can I fix it?

{"@version":"1","host":"x.x.x.x","@timestamp":"2018-07-09T14:18:31.923Zport":57541,"message":"{"@message": "python test message", "@tags": ["hon", "test"]}"}

My local timezone is Time zone: Asia/Bangkok (+07, +0700)

Thank you.


(Magnus B├Ąck) #2

You'd have to use a ruby filter to translate the @timestamp into local time, grab the hour from that time and store it in a field.


(system) #3

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