All Apps and Add-ons

Splunk Find Duplicates Within KV Store And Compare Source

joemarty82
Explorer

Hello,

 

I am having problems trying to find duplicate entries within my splunk kvstore. Basically, what I want to do is find duplicates based on a few fields such as FQDN, CVE, and PORT. Then, once I found duplicates I just want to output them in a table if their SOURCE field is different. The query I have so far is:

| inputlookup vul_kvstore
| stats count by fqdn, port, cve
| where count>1
| table fqdn, port, cve, source

The problem I have now is in my table I do not have access to the source field as it looks like the stats count line basically pulls out only the fqdn, port, and cve data. How do I get access to the source field data? Maybe I just have to revise my original query so I do not loose data to that field but so far nothing I try works. Hopefully someone can provide me some advise to push me through this problem.

 

Thanks,

Joe

Labels (2)

Nisha18789
Builder

Hi @joemarty82 , can you try this

 

| inputlookup vul_kvstore
| stats count by source fqdn, port, cve
| where count>1
| table source, fqdn, port, cve
0 Karma

thambisetty
SplunkTrust
SplunkTrust

| inputlookup vul_kvstore

| stats dc(source) as distinct_source_count values(source) as source by fqdn, port, cve

| where distinct_source_count > 1

| table fqdn, port, cve, source

————————————
If this helps, give a like below.
0 Karma

joemarty82
Explorer

Hey Tham,

 

Thanks for the input. However, this will not work because the source field only contains one entry in each kvstore record. Looks like your solution assumes there are more than 1.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...