<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Dynamic absolute time for alert search results in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Dynamic-absolute-time-for-alert-search-results/m-p/341282#M11492</link>
    <description>&lt;P&gt;Yea it is like that for jobs. But in case of a triggered alert it should be kept longer, i think expiration time is 24h by default for a triggered alert.&lt;/P&gt;</description>
    <pubDate>Wed, 18 Apr 2018 15:58:27 GMT</pubDate>
    <dc:creator>damien_chillet</dc:creator>
    <dc:date>2018-04-18T15:58:27Z</dc:date>
    <item>
      <title>Dynamic absolute time for alert search results</title>
      <link>https://community.splunk.com/t5/Alerting/Dynamic-absolute-time-for-alert-search-results/m-p/341273#M11483</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Background&lt;/STRONG&gt;&lt;BR /&gt;
We're currently running a Scheduled alert (pushing to Slack) with a simple Search query looking for "response=400", running every 5 minutes (cron'd)&lt;BR /&gt;
- "Earliest" set to &lt;STRONG&gt;-5&lt;/STRONG&gt;&lt;BR /&gt;
- "Latest" set to &lt;STRONG&gt;Now&lt;/STRONG&gt; &lt;BR /&gt;
In the Alert body sent to Slack, we're returning the token URL (using $results_link$) to open up Splunk and dive in.  &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Problem&lt;/STRONG&gt;&lt;BR /&gt;
If we look at the Alert more than 5 minutes after the Alert is sent by clicking on the results link, there're no results displayed in Splunk (assuming no errors in the last 5 minutes). So as a workaround, we're currently adding "earliest=-24" to the Splunk query in the browser / entry field. &lt;/P&gt;

&lt;P&gt;How can we preserve the date/time as to when the Search was run to have the results displayed in Splunk despite &lt;STRONG&gt;when&lt;/STRONG&gt; the user clicked on the results link? Perhaps is there a way to pass the date/time from the result URL to be retrieved and/or some other mechanism configuration with date/time settings in the Search query?  I looked at using time modifiers and didn't find anything suiting to this use case. &lt;/P&gt;

&lt;P&gt;We have some issues with Real-Time alerting that we need to solve (internally), so ideally we can stay away from using that for the time being. &lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 13:21:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Dynamic-absolute-time-for-alert-search-results/m-p/341273#M11483</guid>
      <dc:creator>jacobjstewart</dc:creator>
      <dc:date>2018-04-18T13:21:28Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic absolute time for alert search results</title>
      <link>https://community.splunk.com/t5/Alerting/Dynamic-absolute-time-for-alert-search-results/m-p/341274#M11484</link>
      <description>&lt;P&gt;Hi Jacob,&lt;/P&gt;

&lt;P&gt;The link should not have earliest or latest in it, ideally it should refer to the existing job:&lt;BR /&gt;
Something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&lt;A href="https://splunk.instance/app/an_app/@go?sid=&amp;lt;job_id&amp;gt;" target="test_blank"&gt;https://splunk.instance/app/an_app/@go?sid=&amp;lt;job_id&amp;gt;&lt;/A&gt;;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Apr 2018 13:40:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Dynamic-absolute-time-for-alert-search-results/m-p/341274#M11484</guid>
      <dc:creator>damien_chillet</dc:creator>
      <dc:date>2018-04-18T13:40:00Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic absolute time for alert search results</title>
      <link>https://community.splunk.com/t5/Alerting/Dynamic-absolute-time-for-alert-search-results/m-p/341275#M11485</link>
      <description>&lt;P&gt;You can add the command &lt;CODE&gt;addinfo&lt;/CODE&gt; to your search to get the timespan over which the search was run. It'll be like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your current search
| addinfo
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The fields you'll pass to the alert are &lt;CODE&gt;info_min_time&lt;/CODE&gt; (the "earliest" time in the alert search) and &lt;CODE&gt;info_max_time&lt;/CODE&gt; (the "latest" time in the alert search). These will be epoch times, so you can pass them around without worrying about relative time functions that are no longer relevant by the time you review them. Here's some guidance about addinfo:&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.0.3/SearchReference/Addinfo"&gt;https://docs.splunk.com/Documentation/Splunk/7.0.3/SearchReference/Addinfo&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 14:14:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Dynamic-absolute-time-for-alert-search-results/m-p/341275#M11485</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-04-18T14:14:44Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic absolute time for alert search results</title>
      <link>https://community.splunk.com/t5/Alerting/Dynamic-absolute-time-for-alert-search-results/m-p/341276#M11486</link>
      <description>&lt;P&gt;Thank you &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/73198"&gt;@elliotproebstel&lt;/a&gt; and &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213278"&gt;@damien_chillet&lt;/a&gt;. I'm a beginner with splunk, so please bare with me. The URL currently returned does not have the earliest or latest stated (e.g. &lt;A href="http://splunkus.instance/app/search/@go?sid=scheduler__username__search__RMD5465ce29d801b0ccd_at_1523985300_24489" target="_blank"&gt;http://splunkus.instance/app/search/@go?sid=scheduler__username__search__RMD5465ce29d801b0ccd_at_1523985300_24489&lt;/A&gt;)&lt;/P&gt;

&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/73198"&gt;@elliotproebstel&lt;/a&gt;&lt;BR /&gt;
Ok, so no problem appending &lt;CODE&gt;| addinfo&lt;/CODE&gt; to the search. I'm trying to piece together the second point to pass the &lt;CODE&gt;info_min_time&lt;/CODE&gt; and &lt;CODE&gt;info_max_time&lt;/CODE&gt; to the alert.  Do I append those variables to $results_link$? So something like this $results_link.info_min_time.info_max_time$ . ?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:03:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Dynamic-absolute-time-for-alert-search-results/m-p/341276#M11486</guid>
      <dc:creator>jacobjstewart</dc:creator>
      <dc:date>2020-09-29T19:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic absolute time for alert search results</title>
      <link>https://community.splunk.com/t5/Alerting/Dynamic-absolute-time-for-alert-search-results/m-p/341277#M11487</link>
      <description>&lt;P&gt;Wait, is it a real-time search you are talking about?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 15:12:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Dynamic-absolute-time-for-alert-search-results/m-p/341277#M11487</guid>
      <dc:creator>damien_chillet</dc:creator>
      <dc:date>2018-04-18T15:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic absolute time for alert search results</title>
      <link>https://community.splunk.com/t5/Alerting/Dynamic-absolute-time-for-alert-search-results/m-p/341278#M11488</link>
      <description>&lt;P&gt;@damien_chillet, no not a real time search. The alert is based on a Schedule to run every 5 mins. &lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 15:28:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Dynamic-absolute-time-for-alert-search-results/m-p/341278#M11488</guid>
      <dc:creator>jacobjstewart</dc:creator>
      <dc:date>2018-04-18T15:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic absolute time for alert search results</title>
      <link>https://community.splunk.com/t5/Alerting/Dynamic-absolute-time-for-alert-search-results/m-p/341279#M11489</link>
      <description>&lt;P&gt;Is the alert condition "Number of results &amp;gt; 0"?&lt;BR /&gt;
If so the job results should be saved and clicking the link should display the results without having to run the job once more.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 15:36:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Dynamic-absolute-time-for-alert-search-results/m-p/341279#M11489</guid>
      <dc:creator>damien_chillet</dc:creator>
      <dc:date>2018-04-18T15:36:02Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic absolute time for alert search results</title>
      <link>https://community.splunk.com/t5/Alerting/Dynamic-absolute-time-for-alert-search-results/m-p/341280#M11490</link>
      <description>&lt;P&gt;The saved results will expire shortly, since the alert is only looking back over 5 mins. I think the expected lifetime of a search like that is twice the interval over which it runs. &lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 15:48:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Dynamic-absolute-time-for-alert-search-results/m-p/341280#M11490</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-04-18T15:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic absolute time for alert search results</title>
      <link>https://community.splunk.com/t5/Alerting/Dynamic-absolute-time-for-alert-search-results/m-p/341281#M11491</link>
      <description>&lt;P&gt;Yes, the alert condition is set to "Number of results &amp;gt; 0". The behaviour I'm seeing is - if the link is clicked just after the alert is fired (within 1 min say), the results are displayed in Splunk. However, if the link is clicked &amp;gt;= 5 minutes after the alert fired (assuming there hasn't been an exception found since), then the results returned in Splunk are empty as the Relative search is 5 minutes ago. &lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 15:52:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Dynamic-absolute-time-for-alert-search-results/m-p/341281#M11491</guid>
      <dc:creator>jacobjstewart</dc:creator>
      <dc:date>2018-04-18T15:52:21Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic absolute time for alert search results</title>
      <link>https://community.splunk.com/t5/Alerting/Dynamic-absolute-time-for-alert-search-results/m-p/341282#M11492</link>
      <description>&lt;P&gt;Yea it is like that for jobs. But in case of a triggered alert it should be kept longer, i think expiration time is 24h by default for a triggered alert.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 15:58:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Dynamic-absolute-time-for-alert-search-results/m-p/341282#M11492</guid>
      <dc:creator>damien_chillet</dc:creator>
      <dc:date>2018-04-18T15:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic absolute time for alert search results</title>
      <link>https://community.splunk.com/t5/Alerting/Dynamic-absolute-time-for-alert-search-results/m-p/341283#M11493</link>
      <description>&lt;P&gt;Let's try with an example.&lt;BR /&gt;
The search runs at &lt;CODE&gt;13:45&lt;/CODE&gt; for events between &lt;CODE&gt;13:40 and 13:45&lt;/CODE&gt;.&lt;BR /&gt;
It finds 1 error event so an alert link is sent to your slack channel.&lt;/P&gt;

&lt;P&gt;Whatever the time is when you click the link it should load the job which ran at &lt;CODE&gt;13:45&lt;/CODE&gt; for events between &lt;CODE&gt;13:40 and 13:45&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;The time range would change &lt;STRONG&gt;only&lt;/STRONG&gt; if you re-run the job manually.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 16:02:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Dynamic-absolute-time-for-alert-search-results/m-p/341283#M11493</guid>
      <dc:creator>damien_chillet</dc:creator>
      <dc:date>2018-04-18T16:02:52Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic absolute time for alert search results</title>
      <link>https://community.splunk.com/t5/Alerting/Dynamic-absolute-time-for-alert-search-results/m-p/341284#M11494</link>
      <description>&lt;P&gt;Valid example, but I only see the results in Splunk if the link is opened just after &lt;CODE&gt;13:45&lt;/CODE&gt; it seems, so I must be missing something if the time when you click the link shouldn't matter. Any other thoughts? Perhaps there's some back end configuration overriding the $results_link$ parameters to re-run the job? Based on what &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/73198"&gt;@elliotproebstel&lt;/a&gt; was saying, the I need to pass 'info_min_time' and 'info_max_time' into the Alert. &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:03:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Dynamic-absolute-time-for-alert-search-results/m-p/341284#M11494</guid>
      <dc:creator>jacobjstewart</dc:creator>
      <dc:date>2020-09-29T19:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic absolute time for alert search results</title>
      <link>https://community.splunk.com/t5/Alerting/Dynamic-absolute-time-for-alert-search-results/m-p/341285#M11495</link>
      <description>&lt;P&gt;Could you share the alert configuration settings such as expiration time?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 09:28:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Dynamic-absolute-time-for-alert-search-results/m-p/341285#M11495</guid>
      <dc:creator>damien_chillet</dc:creator>
      <dc:date>2018-04-19T09:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic absolute time for alert search results</title>
      <link>https://community.splunk.com/t5/Alerting/Dynamic-absolute-time-for-alert-search-results/m-p/341286#M11496</link>
      <description>&lt;P&gt;I could be missing something, but I can't see how &lt;CODE&gt;addinfo&lt;/CODE&gt; would help here, it would just add fields to your existing search, not change time range the alerts run on.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 09:30:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Dynamic-absolute-time-for-alert-search-results/m-p/341286#M11496</guid>
      <dc:creator>damien_chillet</dc:creator>
      <dc:date>2018-04-19T09:30:07Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic absolute time for alert search results</title>
      <link>https://community.splunk.com/t5/Alerting/Dynamic-absolute-time-for-alert-search-results/m-p/341287#M11497</link>
      <description>&lt;P&gt;My thinking in using addinfo was based on experience with drilldowns where I was able to directly pass the info_min_time and info_max_time through a drilldown to dynamically create a new search running in the same time window. It was meant as a workaround to allow the user to re-run the same search at an arbitrary time in the future, as requested.&lt;/P&gt;

&lt;P&gt;That said, I honestly can't get that approach to the finish line. I can pass those time values through an alert but can't seem to assemble a full search URL with the tokens available to an alert. &lt;/P&gt;

&lt;P&gt;This post from 2016 seems to suggest the solution will lie in editing the TTL for the alert:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/440040/saving-alert-artifacts-for-longer-periods-of-time.html" target="_blank"&gt;https://answers.splunk.com/answers/440040/saving-alert-artifacts-for-longer-periods-of-time.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Unfortunately, at this moment, I can't seem to get any pages from Splunk Docs to load, so I can't provide any updated official guidance.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:04:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Dynamic-absolute-time-for-alert-search-results/m-p/341287#M11497</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2020-09-29T19:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic absolute time for alert search results</title>
      <link>https://community.splunk.com/t5/Alerting/Dynamic-absolute-time-for-alert-search-results/m-p/341288#M11498</link>
      <description>&lt;P&gt;As I posted in a comment above, it seems like the correct solution is probably in modifying the TTL for the alert, but even then - you'll be specifying some period of time during which the search artifacts will continue to live, and after that, they will be gone. If you want a bit of a workaround that's not super clean but will give your alert an indefinite lifetime, you could pass the tokens: &lt;CODE&gt;$result.info_min_time$&lt;/CODE&gt; and &lt;CODE&gt;$result.info_max_time$&lt;/CODE&gt; into the alert body. Those will come through as epoch strings. As &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213278"&gt;@damien_chillet&lt;/a&gt; mentioned above, this will also mean that your search results will all have four fields that they didn't have before we started all this: &lt;CODE&gt;info_min_time&lt;/CODE&gt;, &lt;CODE&gt;info_max_time&lt;/CODE&gt;, &lt;CODE&gt;info_sid&lt;/CODE&gt; (the search ID assigned by Splunk), and &lt;CODE&gt;info_search_time&lt;/CODE&gt; (the time, in epoch value, at which the search was run). To use the epoch strings to re-run the search, you can either add them directly into the SPL (&lt;CODE&gt;earliest=1524052800 latest=1524140780&lt;/CODE&gt;, for example) or you can paste them into the "Advanced" section in the time picker dropdown.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:04:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Dynamic-absolute-time-for-alert-search-results/m-p/341288#M11498</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2020-09-29T19:04:41Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic absolute time for alert search results</title>
      <link>https://community.splunk.com/t5/Alerting/Dynamic-absolute-time-for-alert-search-results/m-p/341289#M11499</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213278"&gt;@damien_chillet&lt;/a&gt;, &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/73198"&gt;@elliotproebstel&lt;/a&gt; &lt;/P&gt;

&lt;P&gt;So in the default alert_actions, email has a default of 86400, but there IS an alert_actions in local, but without a TTL. Then, in the default saved searches, there's a dispatch.ttl of "2p". &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;* If the integer is followed by the letter 'p' Splunk interprets the ttl as a multiple of the scheduled search's execution period (e.g. if the search is scheduled to run hourly and ttl is set to 2p the ttl of the artifacts will be set to 2 hours).&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Considering the above &lt;CODE&gt;2p&lt;/CODE&gt;, if the alert is scheduled for every 5 min then maybe the TTL is 10 min?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:12:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Dynamic-absolute-time-for-alert-search-results/m-p/341289#M11499</guid>
      <dc:creator>jacobjstewart</dc:creator>
      <dc:date>2020-09-29T19:12:55Z</dc:date>
    </item>
  </channel>
</rss>

