# What is timezone that schedule (configuration option in elasticsearch input logstash) is based on?

**URL:** <https://discuss.elastic.co/t/what-is-timezone-that-schedule-configuration-option-in-elasticsearch-input-logstash-is-based-on/334223>\
**Category:** Logstash\
**Created:** [May 24, 2023, 1:07pm UTC](https://discuss.elastic.co/t/what-is-timezone-that-schedule-configuration-option-in-elasticsearch-input-logstash-is-based-on/334223 "2023-05-24T13:07:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alex\_petrov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alex_petrov/32/105688_2.png) [@alex\_petrov](https://discuss.elastic.co/u/alex_petrov)\
**Post date:** [May 24, 2023, 1:07pm UTC](https://discuss.elastic.co/t/what-is-timezone-that-schedule-configuration-option-in-elasticsearch-input-logstash-is-based-on/334223/1 "2023-05-24T13:07:33Z")

</div>

I have following configuration in my logstash pipeline, I want to schedule to run the query for specific hour every day (schedule =\> "\*/5 \* \* \* \*" already working) , but it doesn't work. I have a distributed environment that logstash and elasticsearch servers are seperated..two questions : 1.where the schedule reads date from ?  
2.what is the timezone used for scheduling?

```auto
    input{
        elasticsearch {
            hosts => "ip:9200"
            index => "indexname"
            user => "user"
            password => "elastic"
            query => '{ "query": { "query_string": { "query": "*" } } }'
            schedule => "*/5 17 * * *" #Specifies how often the query should be executed. In this case, it's set to run every 5 minutes
            size => 1500 #Specifies the maximum number of documents to retrieve per query
            scroll => "5m" #Specifies how long Elasticsearch should keep the search context open for the query. In this case, it's set to 5 minutes
            docinfo => true
          }
    }
filter {}
 
        
    output {
      if "API_REQUEST" in [message] {
        jdbc {
          driver_jar_path => '/usr/share/logstash/vendor/jar/jdbc/mssql-jdbc-12.2.0.jre8.jar'
          connection_string => "jdbc:sqlserver://ip:1433;databaseName=izdb;user=user;password=pass;ssl=false;trustServerCertificate=true"
          enable_event_as_json_keyword => true
          statement => [
    "INSERT INTO Transaction (document_id, logLevel, timestamp) VALUES (?,?,?)",
            "document_id",
            "logLevel",
            "timestamp"
          ]
        }
      }
    }
    }

```

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [May 24, 2023, 1:21pm UTC](https://discuss.elastic.co/t/what-is-timezone-that-schedule-configuration-option-in-elasticsearch-input-logstash-is-based-on/334223/2 "2023-05-24T13:21:28Z")

</div>

I would assume that it uses UTC as both Logstash and Elasticsearch uses UTC for dates.

But you can pass a specific timezone if you want, according to the [documentation](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-elasticsearch.html#_scheduling).

---

<div class="post-metadata">

**Author:** ![alex\_petrov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alex_petrov/32/105688_2.png) [@alex\_petrov](https://discuss.elastic.co/u/alex_petrov)\
**Post date:** [May 28, 2023, 4:15pm UTC](https://discuss.elastic.co/t/what-is-timezone-that-schedule-configuration-option-in-elasticsearch-input-logstash-is-based-on/334223/3 "2023-05-28T16:15:04Z")

</div>

I just used schedule =\> "\*/5 1 \* \* \* Asia/Tehran" but the query never run and nothing happen . But when I set it to every 5 minute the data inserted to database . What is the probable cause?

---

<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 25, 2023, 4:15pm UTC](https://discuss.elastic.co/t/what-is-timezone-that-schedule-configuration-option-in-elasticsearch-input-logstash-is-based-on/334223/4 "2023-06-25T16:15:24Z")

</div>

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