All Apps and Add-ons

Handling DBconnect data duplicacy using some unique key

joydeep741
Path Finder

I am using DBConnect to PULL data from DB to SPLUNK.

My DB had 900 rows.
Say, My query runs at 7am and pulls 890 records and stores in an index called db_index.

Now, I realize the query did not get me entire 900 records and I need to re-run the query and store in the same index.

But doing so, I get duplicate events in the same index.

I want to add a unique field to each event everytime my query runs.

So that I can segregate data using that key.
Example:
The query that ran at 9am should have a key 111
The query that ran at 11am should have a key 222

0 Karma

sduff_splunk
Splunk Employee
Splunk Employee

DBConnect supports a rising-column, which is a field that is incremented in some manner after each row is added to the DB. DBConnect then makes sure that each time it runs, it grabs all the rows > the last value of that column, and then remembers the last value again for next time.

https://docs.splunk.com/Documentation/DBX/3.1.4/DeployDBX/Createandmanagedatabaseinputs#Choose_input...

If that doesn't work for you, you can always get the _indextime of the events, and discard any events with an index time less than the last time the query ran.

0 Karma

joydeep741
Path Finder

I dont see an apt field to be masrked for rising-column.

and _indextime comes different for each event. I want a field that is common for the entire data that came when a particular scheduled search ran.

0 Karma
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...