Search pipeline

The arrows in the preceding visualization mean the resulting data from the previous command will be used against the next command in the series. To fully understand this command, let's go through the search pipe by pipe. Type the following commands in succession into the search window, but pause after every one of them and observe how the data changes.

The following command will display the raw events:

SPL> index=_internal sourcetype=splunk*

The next command uses the raw events gathered from the previous step, keys them on the name field, calculates the number of events for the name field, then limits the results to the top five:

SPL> index=_internal sourcetype=splunk* | top limit=5 name  

Finally, the results table of the | top command is passed (also known as piped) on to another command | sort for sorting. Once all activities are complete, the final results are presented in the final output table shown in Splunk:

SPL> index=_internal sourcetype=splunk* | top limit=5 name | sort -
name

This chaining of commands is called the search pipeline.