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!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...