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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...