All Apps and Add-ons

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

chimbudp
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

richgalloway
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, Karma would be appreciated.
Get Updates on the Splunk Community!

A Prelude to .conf25: Your Guide to Splunk University

Heading to Boston this September for .conf25? Get a jumpstart by arriving a few days early for Splunk ...

4 Ways the Splunk Community Helps You Prepare for .conf25

.conf25 is right around the corner, and whether you’re a first-time attendee or a seasoned Splunker, the ...

Enhance Your Splunk App Development: New Tools & Support

UCC FrameworkAdd-on Builder has been around for quite some time. It helps build Splunk apps faster, but it ...