Splunk Search

Is it possible to dedup a subset of events?

MatMeredith
Path Finder

I have a list of different events, including some events where name="exception". These exception events have stack traces associated with them. I want to remove duplicate exceptions based on their stack_trace field, but I want to keep all non-exception events because I'm going to need them later. Can I do this?

Effectively I want to do: dedup stack_trace where name="exception"

Tags (1)
0 Karma

Karthik252
Observer

Does dedup <field_name> keepempty=true work?

0 Karma

cphair
Builder

One way would be to create a new field that contains either the stack_trace value or a value you're pretty confident would be unique in your data, and then dedup on that.


... | eval foo=if(name=="exception", stack_trace, _time . "::" . host ."::" . name) | dedup foo | ...

You might also be able to mess with transaction or stats values(), but those might compress other fields you want to kep.

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

You can create a "pretty unique" field using ... | streamstats count

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!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...