<?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: How do I get the time span (span=X) in a search to automatically adjust depending on the time picker value chosen? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-the-time-span-span-X-in-a-search-to-automatically/m-p/276046#M83274</link>
    <description>&lt;P&gt;That's the best I have.&lt;/P&gt;</description>
    <pubDate>Tue, 20 Oct 2015 15:18:24 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2015-10-20T15:18:24Z</dc:date>
    <item>
      <title>How do I get the time span (span=X) in a search to automatically adjust depending on the time picker value chosen?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-the-time-span-span-X-in-a-search-to-automatically/m-p/276042#M83270</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I want the time span in a search to adjust based upon the time picker value.&lt;/P&gt;

&lt;P&gt;i.e. &lt;/P&gt;

&lt;P&gt;time picker is day, then span=1h&lt;BR /&gt;
month, then span=1d&lt;BR /&gt;
year, then span=1month &lt;/P&gt;

&lt;P&gt;thanks ..&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2015 14:09:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-the-time-span-span-X-in-a-search-to-automatically/m-p/276042#M83270</guid>
      <dc:creator>praspai</dc:creator>
      <dc:date>2015-10-19T14:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get the time span (span=X) in a search to automatically adjust depending on the time picker value chosen?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-the-time-span-span-X-in-a-search-to-automatically/m-p/276043#M83271</link>
      <description>&lt;P&gt;You can try any of these two methods&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/218928/how-to-dynamically-change-the-span-parameter-for-a.html"&gt;https://answers.splunk.com/answers/218928/how-to-dynamically-change-the-span-parameter-for-a.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/79779/passing-span-as-argument-to-timechart.html"&gt;https://answers.splunk.com/answers/79779/passing-span-as-argument-to-timechart.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2015 14:31:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-the-time-span-span-X-in-a-search-to-automatically/m-p/276043#M83271</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-10-19T14:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get the time span (span=X) in a search to automatically adjust depending on the time picker value chosen?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-the-time-span-span-X-in-a-search-to-automatically/m-p/276044#M83272</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| addinfo
| eval timepickerSpanSeconds=(info_max_time - info_min_time)
| eval spanToken=case(timepickerSpanSeconds&amp;gt;=31536000, "1m",
                      timepickerSpanSeconds&amp;gt;=604800,   "1d",
                      timepickerSpanSeconds&amp;lt;60,        "1s",
                      timepickerSpanSeconds&amp;lt;3600,      "1m",
                      true(),                          "1h")
| map search="search index=* earliest=$info_min_time$ latest=$info_max_time$ | timechart count span=$spanToken$ BY host"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Oct 2015 23:47:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-the-time-span-span-X-in-a-search-to-automatically/m-p/276044#M83272</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-10-19T23:47:00Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get the time span (span=X) in a search to automatically adjust depending on the time picker value chosen?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-the-time-span-span-X-in-a-search-to-automatically/m-p/276045#M83273</link>
      <description>&lt;P&gt;Its perfectly working in searches but not in Dashboard. Its not picking value from time picker&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2015 14:25:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-the-time-span-span-X-in-a-search-to-automatically/m-p/276045#M83273</guid>
      <dc:creator>praspai</dc:creator>
      <dc:date>2015-10-20T14:25:42Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get the time span (span=X) in a search to automatically adjust depending on the time picker value chosen?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-the-time-span-span-X-in-a-search-to-automatically/m-p/276046#M83274</link>
      <description>&lt;P&gt;That's the best I have.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2015 15:18:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-the-time-span-span-X-in-a-search-to-automatically/m-p/276046#M83274</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-10-20T15:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get the time span (span=X) in a search to automatically adjust depending on the time picker value chosen?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-the-time-span-span-X-in-a-search-to-automatically/m-p/276047#M83275</link>
      <description>&lt;P&gt;You have to play around with the &lt;CODE&gt;dollar-sign&lt;/CODE&gt; because it is used both by the XML and by the &lt;CODE&gt;map&lt;/CODE&gt; command in the search.  Try adding a second one to each occurrence.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2015 15:20:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-the-time-span-span-X-in-a-search-to-automatically/m-p/276047#M83275</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-10-20T15:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get the time span (span=X) in a search to automatically adjust depending on the time picker value chosen?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-the-time-span-span-X-in-a-search-to-automatically/m-p/276048#M83276</link>
      <description>&lt;P&gt;Thanks ...&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2015 06:25:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-the-time-span-span-X-in-a-search-to-automatically/m-p/276048#M83276</guid>
      <dc:creator>praspai</dc:creator>
      <dc:date>2015-10-21T06:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get the time span (span=X) in a search to automatically adjust depending on the time picker value chosen?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-the-time-span-span-X-in-a-search-to-automatically/m-p/276049#M83277</link>
      <description>&lt;P&gt;You can also do it like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | timechart [
|makeresults 
| addinfo 
| eval timepickerSpanSeconds=(info_max_time - info_min_time) 
| eval span=case(
   timepickerSpanSeconds&amp;gt;=31536000, "1m", 
   timepickerSpanSeconds&amp;gt;=604800, "1d", 
   timepickerSpanSeconds&amp;lt;60, "1s", 
   timepickerSpanSeconds&amp;lt;3600, "1m", 
   true(), "1h") 
| table span 
| format "" "" "" "" "" ""] count BY host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This solution avoids the whole dollar-sign problem entirely.&lt;/P&gt;</description>
      <pubDate>Sat, 27 Feb 2016 02:51:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-the-time-span-span-X-in-a-search-to-automatically/m-p/276049#M83277</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-02-27T02:51:27Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get the time span (span=X) in a search to automatically adjust depending on the time picker value chosen?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-the-time-span-span-X-in-a-search-to-automatically/m-p/276050#M83278</link>
      <description>&lt;P&gt;modify this &lt;CODE&gt;earliest=$info_min_time$ latest=$info_max_time$&lt;/CODE&gt; to look like this &lt;CODE&gt;earliest=$$info_min_time$$ latest=$$info_max_time$$&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2016 20:27:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-the-time-span-span-X-in-a-search-to-automatically/m-p/276050#M83278</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2016-09-15T20:27:08Z</dc:date>
    </item>
  </channel>
</rss>

