Splunk Search

Entering earliest and latest time for backfill summary search. What is the format?

the_wolverine
Champion

I'm having trouble figuring out the proper syntax for specifying an exact date/time for my summary backfill search. For example I have a start date of February 2, 2012 5am. I've tried the following without success:

2012-02-02 05:00:00
02/02/2012 05:00:00
02-02-2012T05:00:00

1 Solution

skawasaki_splun
Splunk Employee
Splunk Employee

It turns out you have to use epoch time. I found this out when I actually opened the fill_summary_index.py script and saw

Usage: splunk cmd python fill_summary_index.py [OPTIONS]

***Note: <boolean> options accept the values "1", "t", "true", or "yes" for true
                                        and "0", "f", "false", or "no" for false

-et <string>            Earliest time (required).  Either a UTC time (integer since unix epoch)
                                        or a Splunk search relative time string [1].

-lt <string>            Latest time (required).  Either a UTC time (integer since unix epoch)
                                        or a Splunk search relative time string [1].

View solution in original post

0 Karma

skawasaki_splun
Splunk Employee
Splunk Employee

It turns out you have to use epoch time. I found this out when I actually opened the fill_summary_index.py script and saw

Usage: splunk cmd python fill_summary_index.py [OPTIONS]

***Note: <boolean> options accept the values "1", "t", "true", or "yes" for true
                                        and "0", "f", "false", or "no" for false

-et <string>            Earliest time (required).  Either a UTC time (integer since unix epoch)
                                        or a Splunk search relative time string [1].

-lt <string>            Latest time (required).  Either a UTC time (integer since unix epoch)
                                        or a Splunk search relative time string [1].
0 Karma

gkanapathy
Splunk Employee
Splunk Employee

I use epoch time format, though other formats should also work.

0 Karma

Simeon
Splunk Employee
Splunk Employee

Usually the summary search is scheduled and this format should work:

%m/%d/%Y:%H:%M:%S

For example, this should search all os data between the 10th and 11th of March:

index=os earliest=03/10/2012:0:0:0 latest=03/11/2012:0:0:0

Detailing where you set this (at the scheduler wizard?) would help.

0 Karma

the_wolverine
Champion

http://docs.splunk.com/Documentation/Splunk/latest/User/ChangeTheTimeRangeOfYourSearch#Syntax_for_re...

This document was referenced in the summary script's help section but it didn't answer my question. I still don't have a working example.

The example provided on that page does not work:
earliest_time=10/19/2009:0:0:0

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...