Splunk® Enterprise

Search Reference

Download manual as PDF

Splunk Enterprise version 6.x is no longer supported as of October 23, 2019. See the Splunk Software Support Policy for details. For information about upgrading to a supported version, see How to upgrade Splunk Enterprise.
This documentation does not apply to the most recent version of Splunk. Click here for the latest version.
Download topic as PDF



The gentimes command is useful in conjunction with the map command.

Generates timestamp results starting with the exact time specified as start time. Each result describes an adjacent, non-overlapping time range as indicated by the increment value. This terminates when enough results are generated to pass the endtime value.

For example, the following search generates four intervals covering one day periods aligning with the calendar days October 1, 2, 3, and 4, during 2015.

| gentimes start=10/1/15 end=10/5/15

This command does not work for future dates.


| gentimes start=<timestamp> [end=<timestamp>] [<increment>]

Required arguments

Syntax: start=<timestamp>
Description: Specify as start time.
Syntax: MM/DD/YYYY[:HH:MM:SS] | <int>
Description: Indicate the timeframe, for example: 10/1/2015 for October 1, 2015, 4/1/2015:12:34:56 for April 1, 2015 at 12:34:56, or -5 for five days ago.

Optional arguments

Syntax: end=<timestamp>
Description: Specify an end time.
Default: midnight, prior to the current time in local time
Syntax: increment=<int>(s | m | h | d)
Description: Specify a time period to increment from the start time to the end time.
Default: 1d


The gentimes command is a generating command and should be the first command in the search. Generating commands use a leading pipe character.


Example 1:

All hourly time ranges from December 1 to December 5 in 2014.

| gentimes start=12/1/14 end=12/5/14 increment=1h

Example 2:

All daily time ranges from 30 days ago until 27 days ago.

| gentimes start=-30 end=-27

Example 3:

All daily time ranges from April 1 to April 5 in 2015.

| gentimes start=4/1/15 end=4/5/15

Example 4:

All daily time ranges from September 25 to today.

| gentimes start=9/25/15

See also



Have questions? Visit Splunk Answers and see what questions and answers the Splunk community has using the gentimes command.

Last modified on 25 July, 2016

This documentation applies to the following versions of Splunk® Enterprise: 6.0, 6.0.1, 6.0.2, 6.0.3, 6.0.4, 6.0.5, 6.0.6, 6.0.7, 6.0.8, 6.0.9, 6.0.10, 6.0.11, 6.0.12, 6.0.13, 6.0.14, 6.0.15, 6.1, 6.1.1, 6.1.2, 6.1.3, 6.1.4, 6.1.5, 6.1.6, 6.1.7, 6.1.8, 6.1.9, 6.1.10, 6.1.11, 6.1.12, 6.1.13, 6.1.14, 6.2.0, 6.2.1, 6.2.2, 6.2.3, 6.2.4, 6.2.5, 6.2.6, 6.2.7, 6.2.8, 6.2.9, 6.2.10, 6.2.11, 6.2.12, 6.2.13, 6.2.14, 6.2.15

Was this documentation topic helpful?

Enter your email address, and someone from the documentation team will respond to you:

Please provide your comments here. Ask a question or make a suggestion.

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