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 | uniqSee also
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
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.
"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"?
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!