Splunk Search

How can I remove duplicate device_id from search within 5 min interval for 24 hours search?

mk197m
New Member

How to remove duplicate device_id within five min interval for 24 hours search,

for example :
10:00am device id =aaa123
10:01am device id =aaa123
10:02am device id =aaa124
10:03am device id =aaa123
10:04am device id =aaa123

10:05am device id =aaa123
10:08am device id =aaa123

10:15am device id =aaa123

10:25am device id =aaa123

expected result:
_time count
10:00 am 2
10:05 am 1
10:10 am 0
10:15 am 1
10:20 am 0
10:25am 1
10:30 am 0

Tags (2)
0 Karma

DalJeanis
SplunkTrust
SplunkTrust

You are looking for thedc() function - distinct count.

Try this...

 | bin _time span=5m
 | stats dc(device_id) by _time
0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...