Splunk Search

How to dedup with multiple criteria?

bworrellZP
Communicator

Hello,

Previously I had a dashboard that was giving out C level some data, where I was deduping based on the SQL Record number (We pull several SQL databases to a warehouse, where I get the data). The dashboard was showing how many times a day a record was accessed, which included any subsequent accesses by the same agent or different agent.

Since that was done, we had some scope creep. He wants to keep that, but now add a higher level that shows only Unique accesses by agent. IE is Agent one goes into Bob Smith, that counts as 1, and if Agent 1 and 2 both access Bob smith, that is one per agent. But both would be listed when going into individual user reports

The data is in two columns, so I thought combining the end user records would get me the details, and doing a search for one agent works, but now my averages and other data it off. Which is where assistance would be nice.

Original search that gave me all touches by department, including retouches.

index="access"  Department |dedup SQLkey | eval Date=strftime(_time, "%D") | chart count by Department Date limit=100

New search, which did not work as expected.

index="access"  Department  | eval combined_lookup=Client."-".EndUser | eval Date=strftime(_time, "%D") | chart count by Department Date limit=100

New search had some duplicates by some agents. When I added a dedup | dedup combined_lookup it removed all duplicates, not just by an individual agent.

Is there a way to modify this, so it will remove only dupes by an individual agent?

Thanks
Brian

Tags (2)
0 Karma
1 Solution

renjith_nair
Legend

You can provide multiple fields in dedup like

|dedup user agent

This will remove only if the combination user and agent are not unique.

If you can provide some sample event with duplicates, your requirement will be more clearer.

---
What goes around comes around. If it helps, hit it with Karma 🙂

View solution in original post

bmacias84
Champion

This it seem like you should you distinct count (dc).

.... | stats dc(SQLkey) by agent
0 Karma

renjith_nair
Legend

You can provide multiple fields in dedup like

|dedup user agent

This will remove only if the combination user and agent are not unique.

If you can provide some sample event with duplicates, your requirement will be more clearer.

---
What goes around comes around. If it helps, hit it with Karma 🙂
Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In April, the Splunk Threat Research Team had 2 releases of new security content via the Enterprise Security ...

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

What are Community Office Hours?Community Office Hours is an interactive 60-minute Zoom series where ...

It’s go time — Boston, here we come!

Are you ready to take your Splunk skills to the next level? Get set, because Splunk University is back, and ...