Search Reference

 


head

This documentation does not apply to the most recent version of Splunk. Click here for the latest version.

head

Synopsis

Returns the first n number of specified results.

Syntax

head [<N> | <eval-expression>] [limit=<int>] [null=<bool>] [keeplast=<bool>]

Arguments

<eval-expression>
Syntax: <eval-expression>
Description: A valid eval expression that evaluates to a Boolean.
keeplast
Syntax: keeplast=<bool>
Description:
limit
Syntax: limit=<int>
Description:
<N>
Syntax: <int>
Description: The number of results to return, default is 10 if none is specified.
null
Syntax: null=<bool>
Description:

Description

Returns the first n results, or 10 if no integer is specified. New for 4.0, can provide a boolean eval expression, in which case we return events until that expression evaluates to false.

Examples

Example 1: Return the first 20 results.

... | head 20

Example 2: Return events until the time span of the data is >= 100 seconds

... | streamstats range(_time) as timerange | head (timerange<100)

See also

reverse, tail

This documentation applies to the following versions of Splunk: 4.0 , 4.0.1 , 4.0.2 , 4.0.3 , 4.0.4 , 4.0.5 , 4.0.6 , 4.0.7 , 4.0.8 , 4.0.9 , 4.0.10 , 4.0.11 View the Article History for its revisions.


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!