Splunk Search

Is there a way to deduplicate data by date?

brcrommett
Engager

I'm trying to run a quarterly report that lists unique individuals in a building. The search lists each building name, individual, apartment, service address, and a number for that individual, then groups by organization and corporation and sums that number by the organization. The data lists these individuals multiple times so I'm using 'dedup Name' to narrow the results, as I want 1 number per individual. That works fine for a single month but I need to display this list for each month in the quarter on the same report.

Is there a way to deduplicate the name by date? perhaps a foreach statement?

current statement

index = csv | table "building name",Name,Apartment,Number,"Service Address",Org,Date,Corp | dedup Name | stats list("Building Name") list(Name) list(Apartment) list("Service Address") list(Number) sum(Number) by Corp,Org,Date

Tags (1)
0 Karma
1 Solution

JDukeSplunk
Builder

Maybe ?

index = csv 
|bucket _time span=1d
| table "building name",Name,Apartment,Number,"Service Address",Org,Date,Corp
| dedup Name , Date
| stats list("Building Name") list(Name) list(Apartment) list("Service Address") list(Number) sum(Number) by Corp,Org,Date

View solution in original post

JDukeSplunk
Builder

Maybe ?

index = csv 
|bucket _time span=1d
| table "building name",Name,Apartment,Number,"Service Address",Org,Date,Corp
| dedup Name , Date
| stats list("Building Name") list(Name) list(Apartment) list("Service Address") list(Number) sum(Number) by Corp,Org,Date

brcrommett
Engager

That's perfect. Thanks!

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...