Splunk Search

Combining 2 searches but need help with dedup strategy

SS1
Path Finder

Hi,

I have 2 searches where the dedup strategy is different, i want to combine the 2 searches but need help with dedup strategy. 

Search 1: index=prod sourcetype=error AND "IOS" | dedup notification, source 

Search 2: index=prod sourcetype=error AND "Android" | dedup _time

-> For "IOS" i need to dedup with only notification, source  and for "Android" i need to dedup only with _time

index=prod sourcetype=error AND ("IOS" OR "Android") | dedup ?????

 

Labels (5)
0 Karma

bowesmana
SplunkTrust
SplunkTrust

To do that in a single search, if Android does not have notification and source fields, then you could make these fields the same as time and then just dedup on those two fields

index=prod sourcetype=error AND ("IOS" OR "Android") 
| eval notification=coalesce(notification, _time)
| eval source=coalesce(source, _time)
| dedup notification source

as long as _time would never equal a real notification/source pair from IOS. stats command is another option if you can decide what you want to get out of the result.

 

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