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!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...