Getting Data In

Not able to find REST endpoint for MySQL App to search the database

vickypandya
Engager

Hello,

I have been using REST for basic searching and getting results from saved searches from splunk via splunk SDK python. Recently I installed MySQL Connector App on my splunk instance. I am wondering if I could do a dbquery search on MySQL App via REST.

I haven't been able to find REST Endpoint to search on MySQL App. I was wondering if someone has already done it or if someone could point me to right direction.

Any help is much appreciated.

Thanks

Vikas

Tags (3)
1 Solution

jbsplunk
Splunk Employee
Splunk Employee

You can use the same REST endpoint that you use for regular Splunk searches - just change the search string to use mysqlquery instead

Regular search:
| search foobar | stats count 

dbquery search:
| mysqlquery spec=mydb query="SELECT * FROM foobar LIMIT 10"

Here's how you can use the REST endpoint to create searches
[http://docs.splunk.com/Documentation/Splunk/5.0/RESTAPI/RESTsearches]

View solution in original post

jbsplunk
Splunk Employee
Splunk Employee

You can use the same REST endpoint that you use for regular Splunk searches - just change the search string to use mysqlquery instead

Regular search:
| search foobar | stats count 

dbquery search:
| mysqlquery spec=mydb query="SELECT * FROM foobar LIMIT 10"

Here's how you can use the REST endpoint to create searches
[http://docs.splunk.com/Documentation/Splunk/5.0/RESTAPI/RESTsearches]

Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...