Splunk Search

java.sql.SQLException: Incorrect syntax near '11'

Cuyose
Builder

I seem to be getting this trying to use the jdbc driverfor SQL whenever I try to run the run.sh

2012-11-13 11:37:04,097 0 [main] ERROR com.splunk.jdbcscriptedinput.Main - java.sql.SQLException: Incorrect syntax near '11'.

query.properties.mssql are below

connectionString=jdbc:sqlserver://172.17.56.215;databaseName=Errors;
username=sa
password=XYZ

driverClass=com.microsoft.sqlserver.jdbc.SQLServerDriver
iteratorField=ERROR_TIME
query=select CATEGORY,ERROR_TIME,APPLICATION from Errors where ERROR_TIME>${ERROR_TIME} order by Errors.ERROR_TIME
dateField=ERROR_TIME

extra=instance=FOO

Tags (1)
0 Karma

Cuyose
Builder

I figured it out, I wasn't returning an integer in the Error_time field so had to modify the query to
query=select CATEGORY,ERROR_TIME,APPLICATION from Errors where Errors.ERROR_TIME>'${ERROR_TIME}' order by Errors.ERROR_TIME

0 Karma

Cuyose
Builder

I still seem to be having an issue in that the query pointer can't parse a datetime format from the database. When it tries to update the query.pointer with a value of '2012-11-13 15:17:05.817' it truncates it to 2012-11-13 15:17:05.8 and the next run results in a null pointer exception. This ends up re-indexing all duplicate data every run as it can't update this field.

0 Karma
Get Updates on the Splunk Community!

Splunk App for Anomaly Detection End of Life Announcment

Q: What is happening to the Splunk App for Anomaly Detection?A: Splunk is officially announcing the ...

Aligning Observability Costs with Business Value: Practical Strategies

 Join us for an engaging Tech Talk on Aligning Observability Costs with Business Value: Practical ...

Mastering Data Pipelines: Unlocking Value with Splunk

 In today's AI-driven world, organizations must balance the challenges of managing the explosion of data with ...