Splunk Search

How to use the time picker $earliest$ and $latest$ time set by the user in my custom Python search command?

johannesschilli
Engager

Hi,

I'm trying to use the $earliest$ and $latest$ time set by the user time picker in my custom search command. I'm using the Python SDK 1.5.0 for this.
I found the input_header field of the SearchCommand class, but it doesn't contain the information I'm looking for.
Is this information available to custom search commands in any way? I'd like to have something like the results produced by the addinfo command.

Thanks for ideas!

0 Karma

rivaanbechan
Engager

Hi,

Here is an example of how you get to these variables:

search_results = self.search_results_info
earliest = int(search_results.search_et)
latest = int(search_results.search_lt)

Hope this helps!
Rivaan

Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...