Splunk Search

How do I group per N minutes and remove duplicates within those?

rune_hellem
Contributor

The inital search is this:

index=myindex myapplication UID=* IDX=* IDOK=*  | dedup IDX |  table _time,UID,IDX,IDOK 

I have been asked to create a report that shows the same for lets say the last 24 hours — but not removing all duplicates, only duplicates within each 5 minutes time slot. I guess time slot is created using span, but not sure how to ensure that I do not get duplicate IDX'es.

Tags (3)

kmorris_splunk
Splunk Employee
Splunk Employee

Give this a try:

index=myindex myapplication UID=* IDX=* IDOK=*  | bin _time span=5m | dedup _time IDX |  table _time,UID,IDX,IDOK

The bin will group in 5 minute chunks. Doing the dedup on both _time (a five minute chunk) and IDX will dedup on IDX within the five minute block.

0 Karma
Get Updates on the Splunk Community!

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 ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...