Splunk® Cloud Services

SPL2 Search Reference

head command syntax details

Syntax

The required syntax is in bold.

head
[keeplast = (true | false)]
[while "("<boolean-expression>")"]
[<limit>]

Required arguments

None. If no options are specified, the head command returns the first 10 results.

Optional arguments

keeplast
Syntax: keeplast=<boolean>
Description: Use in conjunction with the while argument to determine whether the last result in the result set is retained. The last result returned is the result that caused the <boolean-expression> to evaluate to false or NULL. Set keeplast=true to retain the last result in the result set. Set keeplast=false to discard the last result.
Default: true
limit
Syntax: <integer>
Description: The number of results to return.
Default: 10
while
Syntax: while "("<boolean-expression>")"
Description: A expression that evaluates to either true or false, such as <field>=<value>. You cannot use statistical functions in the expression.
Default: false

See also

head command
head command overview
head command usage
head command examples
Last modified on 03 October, 2021
head command overview   head command usage

This documentation applies to the following versions of Splunk® Cloud Services: current


Was this topic useful?







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