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.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...