Getting Data In

Is there any way to force a database input dump of a SQL table to run via script?

ViniciusANT
Explorer

I have SQL table that is cleaned and populated every week .
Using a db tail wont work because all data is regenerated and there is no ID column .

Is there any way to force a db dump of this table via script so I can automate cleaning this index and load the table again ?

0 Karma
1 Solution

pmdba
Builder

DB Connect also allows for full table dumps; they don't need to be dbtail. See the documentation and the inputs.conf specification for more detail, as well as this post on timestamping data correctly as it is indexed into Splunk. A sample dbdump input looks like the following:

[dbmon-dump://mySQL/MyDump]
output.format = kv
output.timestamp = 1
output.timestamp.column = last_update
query = SELECT A.address_id, A.address, A.last_update AS last_update, C.city FROM address A, city C WHERE C.city_id=A.city_id ORDER BY A.city_id
sourcetype = mysourcetype

I would also recommend reading Real-Time Log File Analysis for Oracle 11g for further ideas on how to get data from or about Oracle into Splunk.

View solution in original post

0 Karma

pmdba
Builder

DB Connect also allows for full table dumps; they don't need to be dbtail. See the documentation and the inputs.conf specification for more detail, as well as this post on timestamping data correctly as it is indexed into Splunk. A sample dbdump input looks like the following:

[dbmon-dump://mySQL/MyDump]
output.format = kv
output.timestamp = 1
output.timestamp.column = last_update
query = SELECT A.address_id, A.address, A.last_update AS last_update, C.city FROM address A, city C WHERE C.city_id=A.city_id ORDER BY A.city_id
sourcetype = mysourcetype

I would also recommend reading Real-Time Log File Analysis for Oracle 11g for further ideas on how to get data from or about Oracle into Splunk.

0 Karma

pmdba
Builder

Note that the schedule for the dump can also be defined in inputs.conf. No need for a separate script...

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 ...