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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...