All Apps and Add-ons

DBConnect: How to Edit DB Connections via REST API?


I am using the REST API knowledge in -

But I am not able to update a DB connection. Is there a way to update it without having to delete it? My end goal is to update an identity, but for that, I am thinking if updating the db connection to point to another identity, then deleting the original identity, then creating a new one, and pointing my db connection to it via REST API.

Labels (2)
0 Karma


The solution that I found for this is to use the PUT method instead of a POST and to go to the endpoint specific to the connection.

For example to change "myparam":


curl -k -X PUT -u "admin":"changeit" --url https://localhost:8089/servicesNS/nobody/splunk_app_db_connect/db_connect/dbxproxy/connections/myconnection -d "{\"name\":\"myconnection\",\"identity\":\"myid\",\"connection_type\":\"mytype\",\"myparam\":\"new_value\"}"


 "myconnection" being the name of the connection you want to modify. 

You have to put the name, identity and connection_type parameters otherwise it will throw an error. Also you cannot modify them.

It also works for editing Identities and this time you have to put the name and username parameters : 


curl -k -X PUT -u "admin":"changeit" --url https://localhost:8089/servicesNS/nobody/splunk_app_db_connect/db_connect/dbxproxy/identities/myidentity -d "{\"name\":\"myidentity\",\"username\":\"myuser\",\"myparam\":\"new_value\"}"


Again, "myidentity" being the name of the identity.

0 Karma
Get Updates on the Splunk Community!

.conf23 | Get Your Cybersecurity Defense Analyst Certification in Vegas

We’re excited to announce a new Splunk certification exam being released at .conf23! If you’re going to Las ...

Streamline Data Ingestion With Deployment Server Essentials

REGISTER NOW!Every day the list of sources Admins are responsible for gets bigger and bigger, often making the ...

Remediate Threats Faster and Simplify Investigations With Splunk Enterprise Security ...

REGISTER NOW!Join us for a Tech Talk around our latest release of Splunk Enterprise Security 7.2! We’ll walk ...