All Apps and Add-ons

Insert value into SQL table via dbx application

chimbudp
Contributor

Application:

Splunk db connect

Need:

Need to update a value into SQL table via Splunk dashboard

Query to INSERT a value into SQL table:

| dboutput type=insert database=MyDatabase table=MyTable notFound=insert fields=ColumnName as ColumnValue

| dboutput type=insert database=MyDatabase table=MyTable notFound=insert ColumnName1 as ColumnValue1 CoulmnName2 as CoulumnValue2

Received Error :

command="dboutput", com.splunk.util.csv.CSVException: No CSV input



Tried the above 2 queries , but getting the same Error Message for both

I have already made the database.conf settings. Have set the readonly permission to 'False'

What is the mistake i am making here, am i using the correct format for dboutput query ?

Kindly help.

Tags (3)
0 Karma
1 Solution

cucuro
Explorer

I hope that helps.

| dboutput type=sql database=MyDatabase "INSERT INTO MyTable column, column values column, column"

View solution in original post

jwelsh_splunk
Splunk Employee
Splunk Employee

Here is an actual search command I used and validated it worked:

index=main eventtype="wineventlog-security" | table event_id, EventCode | dboutput database=MSSQLSERVER type=sql "INSERT INTO processes (windows_event_id, windows_event_code) VALUES ($event_id$, $EventCode$)"

Hope it helps.

paulalbert11
Explorer

This was very helpful to me. Thanks!!

0 Karma

cucuro
Explorer

I hope that helps.

| dboutput type=sql database=MyDatabase "INSERT INTO MyTable column, column values column, column"

Get Updates on the Splunk Community!

Dashboards: Hiding charts while search is being executed and other uses for tokens

There are a couple of features of SimpleXML / Classic dashboards that can be used to enhance the user ...

Splunk Observability Cloud's AI Assistant in Action Series: Explaining Metrics and ...

This is the fourth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how ...

Brains, Bytes, and Boston: Learn from the Best at .conf25

When you think of Boston, you might picture colonial charm, world-class universities, or even the crack of a ...