Splunk Cloud

Search Reference

Download manual as PDF

Download topic as PDF



The uniq command works as a filter on the search results that you pass into it. This command removes any search result if that result is an exact duplicate of the previous result. This command does not take any arguments.

Note: We do not recommend running this command against a large dataset.




Example 1:

Keep only unique results from all web traffic in the past hour.

eventtype=webtraffic earliest=-1h@s | uniq

See also



Have questions? Visit Splunk Answers and see what questions and answers the Splunk community has using the uniq command.


This documentation applies to the following versions of Splunk Cloud: 7.0.8, 7.0.11, 7.0.13, 7.1.3, 7.1.6, 7.2.3, 7.2.4, 7.2.6, 7.2.7, 7.2.8, 7.2.9, 8.0.0, 8.0.1, 8.0.2001


Actually, dedup is recommended over the uniq command. However, we do not recommend using either command over large volumes of data. Sorry for the confusion!

Sophy, Splunker
August 16, 2012

dedup command not recommended for _raw field and here you are.<br /><br />Note: We do not recommend that you run the dedup command against the _raw field if you are searching over a large volume of data. Doing this causes Splunk to add a map of each unique _raw value seen which will impact your search performance. This is expected behavior.

August 3, 2012

"If you have a large dataset, it's a better practice to use the dedup command on the _raw field in place of uniq: "<br /><br />Why? What does "better" mean? More efficient? More reliable? Why ever use "uniq" instead of "dedup _raw"?

November 15, 2011

Was this documentation topic helpful?

Enter your email address, and someone from the documentation team will respond to you:

Please provide your comments here. Ask a question or make a suggestion.

You must be logged into splunk.com in order to post comments. Log in now.

Please try to keep this discussion focused on the content covered in this documentation topic. If you have a more general question about Splunk functionality or are experiencing a difficulty with Splunk, consider posting a question to Splunkbase Answers.

0 out of 1000 Characters