Search Reference

 


uniq

uniq

Synopsis

Filters out repeated adjacent results.

Syntax

uniq

Description

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

Note: We don't recommend running this command against a large dataset.

Examples

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

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

See also

dedup

Answers

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: 4.1 , 4.1.1 , 4.1.2 , 4.1.3 , 4.1.4 , 4.1.5 , 4.1.6 , 4.1.7 , 4.1.8 , 4.2 , 4.2.1 , 4.2.2 , 4.2.3 , 4.2.4 , 4.2.5 , 4.3 , 4.3.1 , 4.3.2 , 4.3.3 , 4.3.4 , 4.3.5 , 4.3.6 , 5.0 , 5.0.1 , 5.0.2 View the Article History for its revisions.


Comments

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.

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.

Jangid
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: "

Why? What does "better" mean? More efficient? More reliable? Why ever use "uniq" instead of "dedup _raw"?

Supersleepwalker
November 15, 2011

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

Was this documentation topic helpful?

If you'd like to hear back from us, please provide your email address:

We'd love to hear what you think about this topic or the documentation as a whole. Feedback you enter here will be delivered to the documentation team.

Feedback submitted, thanks!