使用 SQL Server 的日志存储时区异常



我正在使用LogStash 7.3.2版本从SQL Server中提取数据。 它抛出以下异常:

执行 JDBC 查询 {:exception=>#
transition(夏令时"间隙"(时出现异常:1942-09-01T00:00:00.000(亚洲/加尔各答(>}

我在 LogStash 中指定了以下查询:

select * 
from mytable 
where lastupdatetimestamp > :sql_last_value

请告诉我我在这里缺少什么。

我正在使用以下配置:-

jdbc_connection_string => "jdbc:sqlserver://HOST:PORT;databaseName=DB_NAME;integratedSecurity=false
jdbc_user => "USERNAME"
jdbc_password => "PASSWORD"
jdbc_driver_library => "/home/user/LOGSTASH/mssql-jdbc-7.4.1.jre8.jar"
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
statement => "SELECT * FROM TABLE_NAME  where   INCR_COLUMN  >  :sql_last_value  "
schedule => "*/60 * * * * *"
use_column_value => true
tracking_column => "INCR_COLUMN"
tracking_column_type => "timestamp"
record_last_run => true
last_run_metadata_path => "/home/user/LOGSTASH/LAST_RUN/.mssql_USERS_logstash_jdbc_last_run"
connection_retry_attempts => "1000"
connection_retry_attempts_wait_time => "60"
jdbc_default_timezone => "UTC"

你需要把它强制转换为时间戳

WHERE lastupdatetimestamp >  DATETIME(TIMESTAMP :sql_last_value);"

最新更新