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!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...