# Questions about the timezone

**URL:** <https://discuss.elastic.co/t/questions-about-the-timezone/80894>\
**Category:** Logstash\
**Created:** [April 1, 2017, 1:11pm UTC](https://discuss.elastic.co/t/questions-about-the-timezone/80894 "2017-04-01T13:11:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![qin](https://avatars.discourse-cdn.com/v4/letter/q/91b2a8/32.png) [@qin](https://discuss.elastic.co/u/qin)\
**Post date:** [April 1, 2017, 1:11pm UTC](https://discuss.elastic.co/t/questions-about-the-timezone/80894/1 "2017-04-01T13:11:57Z")

</div>

I want to let logstash output to elasticsearch, My configuration is

```auto
input {
    tcp {
        host => "0.0.0.0" 
        port => 4560
        mode => "server"
        codec => json_lines  
      }
}

output {
    stdout{codec =>rubydebug}
    elasticsearch {
        hosts => ["192.168.31.41:9200","192.168.31.42:9200"]  
        flush_size => 10000
        idle_flush_time => 2
        index=>"logstash-task-%{taskId}-%{+YYYYMMddHH}"
     }
}

```

I want let index name is `logstash-task-001-2017040120`, but index name is `logstash-task-001-2017040112`, This may be the time zone problem, how to set ?

---

<div class="post-metadata">

**Author:** ![qin](https://avatars.discourse-cdn.com/v4/letter/q/91b2a8/32.png) [@qin](https://discuss.elastic.co/u/qin)\
**Post date:** [April 1, 2017, 1:51pm UTC](https://discuss.elastic.co/t/questions-about-the-timezone/80894/2 "2017-04-01T13:51:08Z")

</div>

please help me

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [April 1, 2017, 2:01pm UTC](https://discuss.elastic.co/t/questions-about-the-timezone/80894/3 "2017-04-01T14:01:41Z")

</div>

Each index and shard comes with overhead in terms of system resources. Having a large number of very small shards is very inefficient. You seem to want to create an hourly index per task id, which is likely to result in a very large number of small shards unless you have massive volumes of data coming in. What is the expected shard size with this configuration? Why such a small time period per index?

---

<div class="post-metadata">

**Author:** ![qin](https://avatars.discourse-cdn.com/v4/letter/q/91b2a8/32.png) [@qin](https://discuss.elastic.co/u/qin)\
**Post date:** [April 1, 2017, 2:18pm UTC](https://discuss.elastic.co/t/questions-about-the-timezone/80894/4 "2017-04-01T14:18:36Z")

</div>

Thank you for your advice, this is done to achieve production requirements, Even if I create an daily index per task id， the problem of timezone is also there， Because differ for eight hours. Can you understand me? I'm not good at English.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [April 1, 2017, 2:27pm UTC](https://discuss.elastic.co/t/questions-about-the-timezone/80894/5 "2017-04-01T14:27:06Z")

</div>

I am not aware of any way to force the Elasticsearch output plugin to use a non-UTC timezone for the index name. It looks like this issue is tracked in [this GitHub issue](https://github.com/logstash-plugins/logstash-output-elasticsearch/issues/165). You may also be able to get around it by creating the correct date string at the filter stage and use this to form the index name, but I do not have an example of how to do this.

---

<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:** [April 29, 2017, 2:27pm UTC](https://discuss.elastic.co/t/questions-about-the-timezone/80894/6 "2017-04-29T14:27:34Z")

</div>

Closed on April 29, 2017, 2:27pm UTC

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