Splunk® Cloud Services

SPL2 Search Reference

Acrobat logo Download manual as PDF

Acrobat logo Download topic as PDF

head command syntax details


The required syntax is in bold.

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

Required arguments

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

Optional arguments

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
Syntax: <integer>
Description: The number of results to return.
Default: 10
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 documentation topic helpful?

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