# Logstash JDBC Input - Time difference problem

**URL:** <https://discuss.elastic.co/t/logstash-jdbc-input-time-difference-problem/337542>\
**Category:** Logstash\
**Tags:** docker\
**Created:** [July 4, 2023, 9:38am UTC](https://discuss.elastic.co/t/logstash-jdbc-input-time-difference-problem/337542 "2023-07-04T09:38:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![thibaut\_a](https://avatars.discourse-cdn.com/v4/letter/t/77aa72/32.png) [@thibaut\_a](https://discuss.elastic.co/u/thibaut_a)\
**Post date:** [July 4, 2023, 9:38am UTC](https://discuss.elastic.co/t/logstash-jdbc-input-time-difference-problem/337542/1 "2023-07-04T09:38:43Z")

</div>

Hi, I receive entries from a PostgreSQL database in my Logstash Docker container. I get what I want but I'm facing a problem with the timestamp. When I do a request in pgAdmin, it shows timestamps with the local time (France). When looking on Kibana, each line has a 2-hour-difference with the same one on pgAdmin.

I found other posts on the same topic but no one helped me to find a solution. I also tried to use the "timezone" field in the filter, but it didn't change the output in Kibana.

Here is my current input :

```auto
jdbc {
                jdbc_connection_string => "jdbc:postgresql://ip:port/db"
                jdbc_user => "user"
                jdbc_password => "${POSTGRESQL_PASSWORD}"
                jdbc_driver_class => "org.postgresql.Driver"
                statement => "SELECT * FROM my_table WHERE id > :sql_last_value AND (start::date = CURRENT_DATE OR end::date = CURRENT_DATE) ORDER BY id"
                use_column_value => true
                tracking_column => "id"
                tags => ["pg"]
                jdbc_driver_library => "/usr/share/logstash/jdbc/postgresql-42.6.0.jar"
                schedule => "* * * * * Europe/Paris"
        }

```

The request must send today's lines (and I added a condition on the id to avoid duplicate entries).

I want to show timestamps with 2 less hours than what's currently displayed in Kibana. I can share more configuration or output details if needed.

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [July 4, 2023, 4:17pm UTC](https://discuss.elastic.co/t/logstash-jdbc-input-time-difference-problem/337542/2 "2023-07-04T16:17:30Z")

</div>

I suggest your read [this](https://discuss.elastic.co/t/stuck-with-timezone-issue-in-logstash-jdbc-input/236707/4) thread and the various threads that link to or are linked from it.

---

<div class="post-metadata">

**Author:** ![thibaut\_a](https://avatars.discourse-cdn.com/v4/letter/t/77aa72/32.png) [@thibaut\_a](https://discuss.elastic.co/u/thibaut_a)\
**Post date:** [July 5, 2023, 7:20am UTC](https://discuss.elastic.co/t/logstash-jdbc-input-time-difference-problem/337542/3 "2023-07-05T07:20:45Z")

</div>

The field "jdbc\_default\_timezone" solves my problem.

Thank you for your help!

---

<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:** [August 2, 2023, 7:21am UTC](https://discuss.elastic.co/t/logstash-jdbc-input-time-difference-problem/337542/4 "2023-08-02T07:21:30Z")

</div>

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