从SQL Server提取增量数据时出现Logstash异常 [英] Logstash exception while fetching incremental data from SQL Server

查看:235
本文介绍了从SQL Server提取增量数据时出现Logstash异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用LogStash 7.3.2使用以下查询从SQL Server中获取增量数据:

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

我还已经在logstash配置文件中指定了last_run_metadata_path.

I also have specified last_run_metadata_path in logstash config file.

它工作正常,但有时会抛出异常:-

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

执行JDBC查询时出现异常{:exception =>#

转换(夏令时间隔"):1942-09-01T00:00:00.000(亚洲/加尔各答)>}

Exception when executing JDBC query {:exception=>#

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

为什么会出现此异常,由于该异常,它不保存上一个时间戳值,并且再次从SQL Server中获取重复的记录.

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.

推荐答案

此处

Logstash 中,如果datetime字符串不包含TZ part,则假定为UTC time.

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

如果您知道datetime是本地时间字符串,则需要告诉日期过滤器生成日期的时区.您可以使用Joda时区之一,

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,

例如America/New_YorkAmerica/DetroitEST5EDT-这些只是指向时区Java代码的标签,这些代码知道过去很长时间内所有时区中的时钟发生了什么变化.

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.

有关如何遵循更新的信息,请参见此页面. http://www.oracle.com/technetwork/java/javase/tzdata-versions-138805.html 100

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

将datetime字符串转换为Timestamp对象(通过日期过滤器)后,将其视为UTC time.

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

这篇关于从SQL Server提取增量数据时出现Logstash异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆