Splunk Search

How to join log file data from Splunk and data from a table in MySQL.

alenseb
Communicator

Hi All,

I am trying to join a log file(sourceType) which is present in Splunk with data from a table in MySQL through Splunk-MySQL Connector.
I found some few examples online on the type of queries, like these ones:
1. | mysqlquery spec=MyDB query="show tables;"
2. | mysqlquery spec=MyDb query="SELECT * FROM MyTable;"
3. sourcetype=access_* [ mysqlquery spec=MyDb query="SELECT customer_id WHERE purchased_item=rocking_chair" ]

But i am getting a error while using all these. Its says "(1049, u"Unknown database 'splunk'")"

My log file is called "Radius log" and table in MySQL is called "Cust_det" in db called "MyDB".
The log file and table have a common field called "IP_add".

Could anyone help me out with building the query.

Thanks!!

0 Karma
1 Solution

alenseb
Communicator

Sorry for the stupid question.

I had to change the Schema name in the MySQL Connector. Its default value was Splunk, hence the error.

Thanks!!

View solution in original post

0 Karma

alenseb
Communicator

Sorry for the stupid question.

I had to change the Schema name in the MySQL Connector. Its default value was Splunk, hence the error.

Thanks!!

0 Karma

alenseb
Communicator

Sorry for the stupid question.

I had to change the Schema name in the MySQL Connector. Its default value was Splunk, hence the error.

Thanks!!

0 Karma

dart
Splunk Employee
Splunk Employee

Have you run through the setup in the MySQL connector app? It has a browser you can use to verify your connection details

0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...