Splunk Search

Changing the now() reference point before running a saved search

Path Finder

Is it possible to change the value of now (or the reference point it uses) so that I can back-date and run a saved search that uses a relative time window? As an example, say there is a saved search that contains:

earliest=-1h latest=now | stats count by host

In this case I can't change the saved search, but I'd like to run that saved search for say 2016-01-01 01:00. Can I tell the saved search to use that specific time as the reference point of now?

I'm running the search via web export ( /servicesNS/<name>/<app>/search/jobs/export), so curious if there could be a request parameter I could set or something?

0 Karma

Path Finder

For the backfill case you can just use fill_summary_index.py and tell it over which timerange it should run the searches. See

0 Karma


You can't change the value of "now" - it is actually not the current time, but the time when the search started running.

But you can use an absolute time instead of a relative time for earliest and latest. Take a look at the topic Specify time modifiers in your search in the documentation. For example, you could do this

earliest=1/1/2016:0:0:0 latest=1/1/2016:23:59:59

Since you are writing code, you could just do the appropriate time math in your code...

0 Karma

Path Finder

As I mentioned I can't change the saved search, and it was only an example to make the point. There's actually hundreds of saved searches that use relative time periods and various calculations using now(), many of them using summary indexes, which is why I was directly asking about the reference point used by now so that I wouldn't be modifying the searches.

If there was a way to change where now started from, all these reports could be very easily backfilled.

I may be going off on a tangent anyway, is it even possible to run a scheduled search remotely that is set to summary index?

0 Karma
Get Updates on the Splunk Community!

Splunk Cloud | Empowering Splunk Administrators with Admin Config Service (ACS)

Greetings, Splunk Cloud Admins and Splunk enthusiasts! The Admin Configuration Service (ACS) team is excited ...

Tech Talk | One Log to Rule Them All

One log to rule them all: how you can centralize your troubleshooting with Splunk logs We know how important ...

Splunk Security Content for Threat Detection & Response, Q1 Roundup

Join Principal Threat Researcher, Michael Haag, as he walks through: An introduction to the Splunk Threat ...