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!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...