All Apps and Add-ons

To insert hard-code values into SQL Server via Splunk - dbx

Contributor

Requirement :

Need to INSERT some hard-code values into SQL table using splunk db connect app.

I am trying to use the query:

index = MyIndexName |eval Name="Name1"|eval Age="21"|eval Sex="Male"|eval Phone="0123456789"|dedup Name,Age,Sex,Phone| table Name,Age,Sex,Phone | dboutput type=UPDATE database=MyDatabaseName table=MyTableName notFound=INSERT Name Age Sex Phone

Error :

Error in 'dboutput' command: command="dboutput", Missing key column for SQL update (Usage: dboutput ([dboutput-stanza] | type=[insert|update] database=[database] table=[table] notFound=[ignore|fail|insert]+) )

I have added all the columns as per the table design. Still the error says 'missing columns'.
Please help me in using this 'dboutput' command

0 Karma

SplunkTrust
SplunkTrust

You have to specify the key column of the table being updated.

... notFound=INSERT key=Name Name Age Sex Phone
---
If this reply helps you, an upvote would be appreciated.