All Apps and Add-ons

MySQLMonitor

nycct3
New Member

Having difficulty with a class project. We have a Splunk server put up on a windows server 2008 machine. Looking to pull data from a remote MySQL database on the same network. We wanted to know where the configuration file was to use the MySQLMonitor and record the reads and writes of the database.

0 Karma

bonito
Explorer

Hi,

The MySQL monitor app has no ability to log reads and writes to the database in any detail, although it can count the number of select/insert/update/delete queries. The MySQL monitor app has a welcome screen that gives the basic instructions on how to configure it, which will include this functionality.

The two ways I can think of to do anything more complicated -- such as auditing every query:

  1. Enable the general query log, which logs all activity to the database (and can slow it down, as well as use a lot of space). There's no existing Splunk config for this that I know of.
  2. Use the MySQL proxy to intercept queries and log them to Splunk. This should be faster and you can do more fancy things such as only log one in every 10 queries -- which may be enough if you are just looking for more statistical information.

I've put an example MySQL proxy script that can send data to Splunk here: http://pastebin.com/7QUjMhPb. It's definitely incomplete -- it just logs to stdout rather than sending data to a TCP port like I originally intended. I don't know if it works any more -- this is from a couple of years back that never made it into production and I can't really provide any support as I no longer have any idea how it all fits together.

0 Karma
Get Updates on the Splunk Community!

.conf25 Community Recap

Hello Splunkers, And just like that, .conf25 is in the books! What an incredible few days — full of learning, ...

Splunk App Developers | .conf25 Recap & What’s Next

If you stopped by the Builder Bar at .conf25 this year, thank you! The retro tech beer garden vibes were ...

Congratulations to the 2025-2026 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...