All Apps and Add-ons

What's causing the error 'Incorrect syntax near the keyword 'user' when trying to output data to a table containing a field named "user" in DBConnect 3.1.1?

letienne
Path Finder

Hello,

I'm trying to output data to a table containing a field named "user". User being a reserved keyword in SQL, it throws the following error:

2018-05-01 10:15:09.378 +0200  [QuartzScheduler_Worker-10] INFO  com.splunk.dbx.connector.logger.AuditLogger - operation=dboutput connection_name=aaa stanza_name=bbb state=error sql='INSERT INTO "ccc"."dbo"."ddd" (eee,**user**,fff,ggg) values (?,?,?,?)' message='Incorrect syntax near the keyword 'user'.'

Is there any way to workaround this, such as forcing it to be called enclosed by brackets

sql='INSERT INTO "ccc"."dbo"."ddd" ([eee],**[user]**,[fff],[ggg]) values (?,?,?,?)' 

Thanks!

0 Karma
1 Solution

letienne
Path Finder

Answering my own question...

I was able to work around this by enclosing my user (to [user]) field in the customized_mappings stanza in db_outputs.conf and restarting splunk.

View solution in original post

letienne
Path Finder

Answering my own question...

I was able to work around this by enclosing my user (to [user]) field in the customized_mappings stanza in db_outputs.conf and restarting splunk.

Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...