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!

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...