Splunk Search

Can I extract the time value selected from the timerange selection?

RecoMark0
Path Finder

Hello,
I am wondering if the timerange value a user selects for a search is able to be extracted from a field.

For instance, if I select "24 hours", is there a field with a value of "24" or even "86400000" for milliseconds value. I think sideview has a variable, but I was wondering if it is available in just a standard search in splunk.

Thank you!

0 Karma
1 Solution

martin_mueller
SplunkTrust
SplunkTrust

You can add this to your search:

... | addinfo

That will, amongst other things, add two fields info_min_time and info_max_time to your results giving you the beginning and end of the time range used for that search.

http://docs.splunk.com/Documentation/Splunk/6.2.1/SearchReference/addinfo

View solution in original post

martin_mueller
SplunkTrust
SplunkTrust

You can add this to your search:

... | addinfo

That will, amongst other things, add two fields info_min_time and info_max_time to your results giving you the beginning and end of the time range used for that search.

http://docs.splunk.com/Documentation/Splunk/6.2.1/SearchReference/addinfo

RecoMark0
Path Finder

Thank you! This worked perfectly! I created a new field subtracting max_time by min_time to get total seconds

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...