Splunk Search

Dedup command not working after using the stats list command

kmrkunal
New Member

When I am running the following search:

index=main sourcetype="access_combined_wcookie"| stats list(useragent) as Browsers | dedup Browsers consecutive=true

The dedup command is not removing duplicate entries in the browser field.
Can someone explain to me why it is happening?

0 Karma

nareshinsvu
Builder

Did you try mvdedup?

index=main sourcetype="access_combined_wcookie"
| stats list(useragent) as Browsers
| eval Browsers=mvdedup(Browsers)
0 Karma

diogofgm
SplunkTrust
SplunkTrust

While using dedup on a table, splunk will deduplicate values (read cells) of a given field. Your result has a single value/cell (regardless of having multiple values inside it) so there is nothing to dedup.

What you're probably looking for is something like:
index=main sourcetype="access_combined_wcookie"| stats values(useragent) as Browsers

OR

index=main sourcetype="access_combined_wcookie"| stats count by useragent

------------
Hope I was able to help you. If so, some karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...