# Logstash JDBC input cannot determine timezone from nil

**URL:** <https://discuss.elastic.co/t/logstash-jdbc-input-cannot-determine-timezone-from-nil/362996>\
**Category:** Logstash\
**Created:** [July 12, 2024, 6:51am UTC](https://discuss.elastic.co/t/logstash-jdbc-input-cannot-determine-timezone-from-nil/362996 "2024-07-12T06:51:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![chun](https://avatars.discourse-cdn.com/v4/letter/c/a87d85/32.png) [@chun](https://discuss.elastic.co/u/chun)\
**Post date:** [July 12, 2024, 6:51am UTC](https://discuss.elastic.co/t/logstash-jdbc-input-cannot-determine-timezone-from-nil/362996/1 "2024-07-12T06:51:26Z")

</div>

I'm getting an error while running logstash

" (ArgumentError) Cannot determine timezone from nil\n(secs:1720605029.799,utc~:"2024-07-10 09:50:29.7990000247955322",ltz~:nil)"

I have tried the solution from other threads, but didn't work.

The timezone of the server is ASIA/HONG\_KONG. Here is my pipeline cofiguration:

```auto
input {
  jdbc {
    jdbc_driver_library => "C:/Users/XXXXX/Downloads/exajdbc.jar" 
    jdbc_driver_class => "com.exasol.jdbc.EXADriver"
    jdbc_connection_string => "jdbc:exa:10.7.1.200/C7B0A2EC5D08CDBABBBCAACEE1C872CDBE548DC98B74A02EA57438AEA067FC8B:8563/exa_db?useTimezone=true&useLegacyDatetimeCode=false&serverTimezone=ASIA/HONG_KONG" 
    jdbc_user => "XXXXXX" 
    jdbc_password => "XXXXX" 
	plugin_timezone => local
	jdbc_default_timezone => "ASIA/HONG_KONG"
	TZ => "ASIA/HONG_KONG"
        jdbc_paging_enabled => true
        tracking_column => "login_time"
        use_column_value => true
        tracking_column_type => "numeric"
        schedule => "*/5 * * * * *"
        statement => "SELECT * FROM EXA_DBA_AUDIT_SESSIONS WHERE login_time > :sql_last_value ORDER BY login_time ASC"
  }
}
filter {

}
output {
  stdout { codec => "rubydebug"}
}

```

ELK stack version 8.14.2

Is there any solution?

---

<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:** [July 12, 2024, 12:31pm UTC](https://discuss.elastic.co/t/logstash-jdbc-input-cannot-determine-timezone-from-nil/362996/2 "2024-07-12T12:31:18Z")

</div>

> [@chun](#):
>
> `jdbc_default_timezone => "ASIA/HONG_KONG"`

Have you tried using the correct canonical name, which is **Asia/Hong\_Kong**?

You are using it in all caps, not sure if this will have any effect or not.

---

<div class="post-metadata">

**Author:** ![chun](https://avatars.discourse-cdn.com/v4/letter/c/a87d85/32.png) [@chun](https://discuss.elastic.co/u/chun)\
**Post date:** [July 15, 2024, 4:34am UTC](https://discuss.elastic.co/t/logstash-jdbc-input-cannot-determine-timezone-from-nil/362996/3 "2024-07-15T04:34:51Z")

</div>

ASIA/HONG\_KONG is what I got when I query the timezone setting in Exasol DB. I tried to change jdbc\_default\_timezone =\> "Asia/Singapore" in pipleline configuration, still got the same error.

---

<div class="post-metadata">

**Author:** ![chun](https://avatars.discourse-cdn.com/v4/letter/c/a87d85/32.png) [@chun](https://discuss.elastic.co/u/chun)\
**Post date:** [July 15, 2024, 7:54am UTC](https://discuss.elastic.co/t/logstash-jdbc-input-cannot-determine-timezone-from-nil/362996/4 "2024-07-15T07:54:13Z")

</div>

Tried Asia/Hong\_Kong, not working either.

---

<div class="post-metadata">

**Author:** ![chun](https://avatars.discourse-cdn.com/v4/letter/c/a87d85/32.png) [@chun](https://discuss.elastic.co/u/chun)\
**Post date:** [July 15, 2024, 8:55am UTC](https://discuss.elastic.co/t/logstash-jdbc-input-cannot-determine-timezone-from-nil/362996/5 "2024-07-15T08:55:07Z")

</div>

The issue is resolved after I set timezone in windows with following command:

```auto
set TZ="Asia/Hong_Kong"
tzutil /s "China Standard Time_dstoff"

```

Thanks @leandrojmp !
