<?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: Search Language variable for search duration in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Search-Language-variable-for-search-duration/m-p/29403#M5928</link>
    <description>&lt;P&gt;You just saved my day dwaddle, thx&lt;/P&gt;</description>
    <pubDate>Tue, 07 May 2013 15:24:09 GMT</pubDate>
    <dc:creator>chris</dc:creator>
    <dc:date>2013-05-07T15:24:09Z</dc:date>
    <item>
      <title>Search Language variable for search duration</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-Language-variable-for-search-duration/m-p/29401#M5926</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
I was curious if there was a way to reference a search duration for use within the search? Primarily for use inside a dashboard. If the timepicker selects a 5 day duration then the search string could have a variable which would be the value from the timepicker in seconds (so for 5 days the value would be 432000 seconds). I'm not sure if this is possible without adding apps/custom modules.&lt;/P&gt;

&lt;P&gt;Thank you for any help!&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2011 15:50:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-Language-variable-for-search-duration/m-p/29401#M5926</guid>
      <dc:creator>aputz</dc:creator>
      <dc:date>2011-06-16T15:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: Search Language variable for search duration</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-Language-variable-for-search-duration/m-p/29402#M5927</link>
      <description>&lt;P&gt;Yes, using &lt;CODE&gt;addinfo&lt;/CODE&gt; and &lt;CODE&gt;eval&lt;/CODE&gt;.  &lt;CODE&gt;addinfo&lt;/CODE&gt; will add four time_t fields -- &lt;CODE&gt;info_min_time&lt;/CODE&gt; and &lt;CODE&gt;info_max_time&lt;/CODE&gt; being the useful ones for your purpose.  Considering they are both time_t, duration is just a matter of arithmetic.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;my_search | addinfo | eval tpwindow=info_max_time - info_min_time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="http://www.splunk.com/base/Documentation/latest/SearchReference/Addinfo" target="_blank"&gt;http://www.splunk.com/base/Documentation/latest/SearchReference/Addinfo&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:41:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-Language-variable-for-search-duration/m-p/29402#M5927</guid>
      <dc:creator>dwaddle</dc:creator>
      <dc:date>2020-09-28T09:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: Search Language variable for search duration</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-Language-variable-for-search-duration/m-p/29403#M5928</link>
      <description>&lt;P&gt;You just saved my day dwaddle, thx&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2013 15:24:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-Language-variable-for-search-duration/m-p/29403#M5928</guid>
      <dc:creator>chris</dc:creator>
      <dc:date>2013-05-07T15:24:09Z</dc:date>
    </item>
  </channel>
</rss>

