Splunk Search

earliest and latest information in custom python search command

sbsbb
Builder

I was not able to find in the doc a way to get earliest and latest information from the datetimepicker to use in my generating custom search command..

Any Idea how that work ?

lumpymilk
Explorer

For the sake of anyone searching and finding this, these return a float that matches time picker when I try them. I just wish I could find inheritable or nested Option() types so I can borrow those with their existing validation.

earliest = self.search_results_info.api_et
latest = self.search_results_info.api_lt

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

You could prefix the call to your custom generating command like this:

| stats count | addinfo | your_command

That way you should get info about the time range as input events for your command.

I don't think there's an intended way for accessing this directly - any more. Taken from the doc of splunk.Intersplunk:

getOrganizedResults(input_str=None)
    Converts an Intersplunk-formatted file object into a dict
    representation of the contained events, and returns a tuple of:

        (results, dummyresults, settings)

    "dummyresults" is always an empty list, and "settings" is always
    an empty dict, since the change to csv stopped sending the
    searchinfo.  It has not been updated to store the auth token.

My guess is you're looking for what used to be in searchinfo.

0 Karma
Get Updates on the Splunk Community!

What’s new on Splunk Lantern in August

This month’s Splunk Lantern update gives you the low-down on all of the articles we’ve published over the past ...

Welcome to the Future of Data Search & Exploration

You have more data coming at you than ever before. Over the next five years, the total amount of digital data ...

This Week's Community Digest - Splunk Community Happenings [8.3.22]

Get the latest news and updates from the Splunk Community here! News From Splunk Answers ✍️ Splunk Answers is ...