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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...