Splunk Search

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

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

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

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