# How dockernized logstash knows system time zone?

**URL:** https://discuss.elastic.co/t/how-dockernized-logstash-knows-system-time-zone/180921
**Category:** Logstash
**Created:** [May 14, 2019, 6:03am UTC](https://discuss.elastic.co/t/how-dockernized-logstash-knows-system-time-zone/180921 "2019-05-14T06:03:51Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![codequokka](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/codequokka/32/46115_2.png) [@codequokka](https://discuss.elastic.co/u/codequokka)
#### Post date: [May 14, 2019, 6:03am UTC](https://discuss.elastic.co/t/how-dockernized-logstash-knows-system-time-zone/180921/1 "2019-05-14T06:03:51Z")

</div>

Hi

I'm using [docker.elastic.co/logstash/logstash-oss:7.0.1](http://docker.elastic.co/logstash/logstash-oss:7.0.1).  
Docker host(my pc) and logstash container are running in different timezone.

- Timezone of docker host is JST

```auto
$ date
Tue May 14 14:12:22 JST 2019

```

- Timezone of logstash container is UTC

```auto
bash-4.2$ date
Tue May 14 05:13:50 UTC 2019

```

I let logstash reads a file on docker host has JST epochtime,  
and transforms JST epochtime to @timestamp by using date filter plugin.

```auto
filter {
    date {
        match => ["beginning_time", "UNIX"] # beginning_time: 1557808919 is JST epochtime
    }
}

```

As a result, @timestamp is converted JST to UTC automatically.  
(This feature is very useful in different timezone)

```auto
{
          "@timestamp" => 2019-05-14T04:41:59.000Z, # Converted JST to UTC
      "beginning_time" => "1557808919",
    "executed_command" => "pwd",
                "tags" => [
        [0] "zsh_history"
    ]
}

```

> [@How the logstash get my timezone](https://discuss.elastic.co/t/how-the-logstash-get-my-timezone/130410):
>
> i meet a problem when i send a timestamp to logstash it can turn it to utc .but i didn't set my timezone where it get it ? from my pc? [TimeStamp:2018-05-14 15:20:10]ddd { "@version" =\> "1", "MSG" =\> "ddd\r", "host" =\> "BIH-D-6331", "TimeStamp" =\> "2018-05-14 15:20:10", "message" =\> "[TimeStamp:2018-05-14 15:20:10]ddd\r", "TS" =\> 2018-05-14T07:20:10.000Z, "@timestamp" =\> 2018-05-03T08:23:21.824Z } why it know my timezone is +08:00

I learned from logstash timezone is determined by system default timezone above post.

In my case, logstash in docker is running in UTC.  
Therefore I think timezone of logstash in docker is too UTC.  
But logtash behaves as timezone is JST.  
How logstash knows docker host is running in JST?

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [June 11, 2019, 6:04am UTC](https://discuss.elastic.co/t/how-dockernized-logstash-knows-system-time-zone/180921/2 "2019-06-11T06:04:04Z")

</div>

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