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.

Examples

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

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

Note: If you have a large dataset, it's more efficient to use the dedup command on the _raw field in place of uniq:

... | dedup _raw

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 View the Article History for its revisions.


Comments

"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!