elastalert icon indicating copy to clipboard operation
elastalert copied to clipboard

How can I change timezone from UTC?

Open UglyAnimal opened this issue 7 years ago • 1 comments

I have tried to run container with switch -e TZ=Europe/Helsinki . After that when I run date inside container I get correct time and timezone. But when I run docker logs -f elastalert I see logs with UTC timezone. Also I have tried to run this command inside container without success:

ln -sf /usr/share/zoneinfo/Europe/Helsinki /etc/localtime
echo "Europe/Helsinki" > /etc/timezone

Also I have tried to change TZ variable inside Dockerfile and build image, same issue.

UglyAnimal avatar Feb 12 '19 12:02 UglyAnimal

Hello!!

I think that I'm having the same problem. In docker container when I execute:

docker exec -it elastalert date

I get my timezone (CEST) correctly, the same as if I execut date in my OS, but when I test a rule I get this:

silence - {'rule_name': 'Prueba blacklist', '@timestamp': datetime.datetime(2019, 4, 3, 6, 19, 48, 392705, tzinfo=tzutc()), 'exponent': 0, 'until': datetime.datetime(2019, 4, 3, 6, 20, 48, 392693, tzinfo=tzutc())}

As we can see, the timezone seems to be UTC so the hour that is obtained is not the time of my time zone, it's two hours less. How can I fix this? Thank you and sorry for my english.

silviag2 avatar Apr 03 '19 06:04 silviag2