Logstash exception while fetching incremental data from SQL Server

点点圈 提交于 2020-02-06 18:06:29

问题


I am using LogStash 7.3.2 to fetch incremental data from SQL Server using this query:

select * from mytable where lastupdatetimestamp > :sql_last_value

I also have specified last_run_metadata_path in logstash config file.

It works fine but sometimes it is throwing an exception:-

Exception when executing JDBC query {:exception=>#

transition (daylight savings time 'gap'): 1942-09-01T00:00:00.000 (Asia/Kolkata)>}

Why am I getting this exception and due to this exception it does not save last timestamp value and again it fetches duplicate records from SQL Server.

Any help regarding this would be highly appreciated.


回答1:


As stated here

In Logstash if a datetime string has no TZ part it is assumed to be a UTC time.

If you know that the datetime is a local time string then you need to tell the date filter which timezone the date was generated in. You may use one of the Joda timezones,

e.g. America/New_York, America/Detroit or EST5EDT - these are merely labels that point to Timezone Java code that know what changes in clocks occurred in all timezones for quite some time into the past.

See this page for info on how the updates are followed. http://www.oracle.com/technetwork/java/javase/tzdata-versions-138805.html 100

Once the datetime string is converted to a Timestamp object (by the date filter) it is considered UTC time.



来源:https://stackoverflow.com/questions/59242988/logstash-exception-while-fetching-incremental-data-from-sql-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!