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!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...