<?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: Running one of two searches  based on time picker selection in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Running-one-of-two-searches-based-on-time-picker-selection/m-p/364421#M40582</link>
    <description>&lt;P&gt;Yes... true... I have seen that before as well. Could not help it. Maybe mentioning in the answer itself is better.&lt;/P&gt;</description>
    <pubDate>Fri, 06 Oct 2017 07:33:50 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2017-10-06T07:33:50Z</dc:date>
    <item>
      <title>Running one of two searches  based on time picker selection</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Running-one-of-two-searches-based-on-time-picker-selection/m-p/364411#M40572</link>
      <description>&lt;P&gt;I am trying to create a dashboard panel which will run one of the following email searches.  There are a number of inputs which allow a user to filter exactly what he/she wants to search for.  &lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;One input allows a user to select the search criteria (sender, recipient, source IP, message id, etc.)&lt;/LI&gt;
&lt;LI&gt;Another input allow the user to input the data being searched for.&lt;/LI&gt;
&lt;LI&gt;The last input is a time picker.&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Each input is a separate token.  So, if one wants to search for sender=&lt;A href="mailto:john.doe@xyz.org"&gt;john.doe@xyz.org&lt;/A&gt;, for example, those values (sender, &lt;A href="mailto:john.doe@xyz.org"&gt;john.doe@xyz.org&lt;/A&gt;) would each be passed to the search with tokens.&lt;/P&gt;

&lt;P&gt;If the time selected from the time picker is within the last 24h, a search based on raw events (including index=, eventtype=, stats, etc.) should be run.  If the time selected is historic (ie. more than 24h ago), I want to run a search based on a summary index (index=summary report=x).&lt;/P&gt;

&lt;P&gt;I have been working to figure this out, but each attempt has been unsuccessful.  Assistance with this will greatly be appreciated.&lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2017 05:25:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Running-one-of-two-searches-based-on-time-picker-selection/m-p/364411#M40572</guid>
      <dc:creator>adamblock2</dc:creator>
      <dc:date>2017-10-03T05:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: Running one of two searches  based on time picker selection</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Running-one-of-two-searches-based-on-time-picker-selection/m-p/364412#M40573</link>
      <description>&lt;P&gt;maybe check this one - &lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/488877/how-to-run-two-different-searches-in-a-dashboard-b.html"&gt;https://answers.splunk.com/answers/488877/how-to-run-two-different-searches-in-a-dashboard-b.html&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;This is just an idea so far: try to add &amp;lt;condition&amp;gt; and &amp;lt;eval&amp;gt; children under &amp;lt;change&amp;gt; child of the &amp;lt;input type="time"...&amp;gt; tag. Analyze the values and set or unset the tokens according to your needs. Then create a few panels at most one of which will be visible using depends= and rejects= attributes in those panels' tags.

You'll have to read "Dashboards and Visualizations" manual to do everything right. Unfortunately, the documentation does not include ready examples of such complex behavior, but that's the beauty of Splunk development.

Another, a somewhat different idea, is to add id= attribute to your time input and create a JavaScript which will find the time picker by that id and hook a handler to the .change event. In that handler, you can set and unset some tokens to achieve the same result (your panels should still have depends= and rejects= attributes for this to work), but you'll have a much better control of the algorithm.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Oct 2017 05:55:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Running-one-of-two-searches-based-on-time-picker-selection/m-p/364412#M40573</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2017-10-03T05:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: Running one of two searches  based on time picker selection</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Running-one-of-two-searches-based-on-time-picker-selection/m-p/364413#M40574</link>
      <description>&lt;P&gt;&lt;STRONG&gt;[Update]&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Reattaching image as URL, since original image got removed.&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://wiki.splunk.com/images/1/1d/UseTokensFromTimeSelectors.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/121938"&gt;@adamblock2&lt;/a&gt;, questions on similar lines have definitely been answered before. To document the answer I am providing a generic run anywhere example, which should also fit in your use case. &lt;/P&gt;

&lt;P&gt;Time Picker does not always provide epoch time values via default earliest and latest tokens (it may have "snap to" time format like "-1h@h" etc. Hence the same can not be used for time based calculations in the dashboard. In order to tackle this situations you have following two options:&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/216669-usetokensfromtimeselectors.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;PS: For line breaks in the code &lt;CODE&gt;&amp;amp;lt;br\&amp;amp;gt;&lt;/CODE&gt; needs to be replaced as &lt;CODE&gt;&amp;lt;br\&amp;gt;&lt;/CODE&gt;, since the same is getting escaped here on Splunk Answers while posting the code.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Option 1- Use search event handler to capture Earliest and Latest String time through $job.earliestTime$ and $job.latestTime$&lt;/STRONG&gt;&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;&lt;STRONG&gt;Step 1)&lt;/STRONG&gt; Run a dummy search (only use &lt;CODE&gt;| makeresults&lt;/CODE&gt; to ensure actual index search is not performed) with the time tokens (assuming time picker field name is &lt;CODE&gt;tokTime&lt;/CODE&gt;) as  $tokTime.earliest$ and $tokTime.latest$.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Step 2)&lt;/STRONG&gt; Code the Search Event Handler (in the example I have used &lt;CODE&gt;&amp;lt;done&amp;gt;&lt;/CODE&gt;, &lt;CODE&gt;&amp;lt;progress&amp;gt;&lt;/CODE&gt; can also be used. These Search Event Handlers can access default search time tokens i.e. $job.earliestTime$ and $job.latestTime$. But in String time format not epoch.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Step 3)&lt;/STRONG&gt; Use &lt;CODE&gt;&amp;lt;eval&amp;gt;&lt;/CODE&gt; tag to convert  from String Time to Epoch time using &lt;CODE&gt;strptime()&lt;/CODE&gt; function and set the tokens. &lt;CODE&gt;tokEarliestTime1&lt;/CODE&gt; and &lt;CODE&gt;tokLatestTime1&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Step 4)&lt;/STRONG&gt; Set the &lt;CODE&gt;tokCurrentTime1&lt;/CODE&gt; as &lt;CODE&gt;now()&lt;/CODE&gt; and using eval tag calculate the &lt;CODE&gt;duration1&lt;/CODE&gt; token. &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Step 5)&lt;/STRONG&gt; Use eval tag to set the token for index &lt;CODE&gt;tokIndex1&lt;/CODE&gt; either as YourSummaryIndexName or YourRealTimeIndexName based on duration between tokCurrentTime1 and tokEarliestTime1 being greater than 86400 or not. &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Option 2- Use addinfo SPL command to generate info_min_time and info_max_time in a dummy search&lt;/STRONG&gt;&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;&lt;STRONG&gt;Step 1)&lt;/STRONG&gt; Run a dummy search (only use &lt;CODE&gt;| makeresults | addinfo&lt;/CODE&gt; to ensure actual index search is not performed and search job time tokens &lt;CODE&gt;info_min_time&lt;/CODE&gt; and &lt;CODE&gt;info_max_time&lt;/CODE&gt; are generated) with the time tokens (assuming time picker field name is &lt;CODE&gt;tokTime&lt;/CODE&gt;) as  $tokTime.earliest$ and $tokTime.latest$.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Step 2)&lt;/STRONG&gt; Code the Search Event Handler (in the example I have used &lt;CODE&gt;&amp;lt;done&amp;gt;&lt;/CODE&gt;, &lt;CODE&gt;&amp;lt;progress&amp;gt;&lt;/CODE&gt; can also be used. These Search Event Handlers can access first row of results using &lt;CODE&gt;$result.&amp;lt;fieldname&amp;gt;$&lt;/CODE&gt;. &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Step 3)&lt;/STRONG&gt; Use $result.info_min_time$ and $result.info_max_time$ to set Earliest and Latest Search Epoch Time tokens i.e. &lt;CODE&gt;tokEarliestTime2&lt;/CODE&gt; and &lt;CODE&gt;tokLatestTime2&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Step 4)&lt;/STRONG&gt; Set the &lt;CODE&gt;tokCurrentTime2&lt;/CODE&gt; as &lt;CODE&gt;now()&lt;/CODE&gt; and using eval tag calculate the &lt;CODE&gt;duration2&lt;/CODE&gt; token. &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Step 5)&lt;/STRONG&gt; Use eval tag to set the token for index &lt;CODE&gt;tokIndex2&lt;/CODE&gt; either as YourSummaryIndexName or YourRealTimeIndexName based on duration between tokCurrentTime2 and tokEarliestTime2 being greater than 86400 or not.&lt;/P&gt;

&lt;P&gt;PS: For this use case we only require $job.earliestTime$ which is used compare with the current time &lt;CODE&gt;now()&lt;/CODE&gt; and calculate the time difference required to set the index to either &lt;CODE&gt;summary&lt;/CODE&gt; or &lt;CODE&gt;real-time&lt;/CODE&gt; based on the duration &amp;gt;24*60*60 i.e. 86400 or not.&lt;/P&gt;

&lt;P&gt;Following is the run anywhere dashboard source code for above options. Please try out and confirm:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;Splunk Answers 578984 - Timepicker Choose Index based on time&amp;lt;/label&amp;gt;
  &amp;lt;search&amp;gt;
    &amp;lt;query&amp;gt;| makeresults
    &amp;lt;/query&amp;gt;
    &amp;lt;earliest&amp;gt;$tokTime.earliest$&amp;lt;/earliest&amp;gt;
    &amp;lt;latest&amp;gt;$tokTime.latest$&amp;lt;/latest&amp;gt;
    &amp;lt;done&amp;gt;
      &amp;lt;eval token="tokEarliestTimeString1"&amp;gt;strftime(strptime($job.earliestTime$,"%Y/%m/%d %H:%M:%S %p"),"%Y/%m/%d %H:%M:%S %p")&amp;lt;/eval&amp;gt;
      &amp;lt;eval token="tokLatestTimeString1"&amp;gt;strftime(strptime($job.latestTime$,"%Y/%m/%d %H:%M:%S %p"),"%Y/%m/%d %H:%M:%S %p")&amp;lt;/eval&amp;gt;
      &amp;lt;eval token="tokCurrentTimeString1"&amp;gt;strftime(now(),"%Y/%m/%d %H:%M:%S %p")&amp;lt;/eval&amp;gt;
      &amp;lt;eval token="tokEarliestTime1"&amp;gt;strptime($job.earliestTime$,"%Y/%m/%d %H:%M:%S %p")&amp;lt;/eval&amp;gt;
      &amp;lt;eval token="tokLatestTime1"&amp;gt;strptime($job.latestTime$,"%Y/%m/%d %H:%M:%S %p")&amp;lt;/eval&amp;gt;
      &amp;lt;eval token="tokCurrentTime1"&amp;gt;now()&amp;lt;/eval&amp;gt;
      &amp;lt;eval token="duration1"&amp;gt;now()-tokEarliestTime1&amp;lt;/eval&amp;gt;      
      &amp;lt;eval token="tokIndex1"&amp;gt;if((now()-tokEarliestTime1) &amp;amp;lt;=86400,"yourRealTimeIndex","yourSummaryIndex")&amp;lt;/eval&amp;gt;
    &amp;lt;/done&amp;gt;
  &amp;lt;/search&amp;gt;
  &amp;lt;search&amp;gt;
    &amp;lt;query&amp;gt;| makeresults
| addinfo
    &amp;lt;/query&amp;gt;
    &amp;lt;earliest&amp;gt;$tokTime.earliest$&amp;lt;/earliest&amp;gt;
    &amp;lt;latest&amp;gt;$tokTime.latest$&amp;lt;/latest&amp;gt;
    &amp;lt;done&amp;gt;
      &amp;lt;eval token="tokEarliestTimeString2"&amp;gt;strftime($result.info_min_time$,"%Y/%m/%d %H:%M:%S %p")&amp;lt;/eval&amp;gt;
      &amp;lt;eval token="tokLatestTimeString2"&amp;gt;strftime($result.info_max_time$,"%Y/%m/%d %H:%M:%S %p")&amp;lt;/eval&amp;gt;
      &amp;lt;eval token="tokCurrentTimeString2"&amp;gt;strftime(now(),"%Y/%m/%d %H:%M:%S %p")&amp;lt;/eval&amp;gt;
      &amp;lt;eval token="tokEarliestTime2"&amp;gt;$result.info_min_time$&amp;lt;/eval&amp;gt;
      &amp;lt;eval token="tokLatestTime2"&amp;gt;$result.info_max_time$&amp;lt;/eval&amp;gt;
      &amp;lt;eval token="tokCurrentTime2"&amp;gt;now()&amp;lt;/eval&amp;gt;
      &amp;lt;eval token="duration2"&amp;gt;now()-tokEarliestTime2&amp;lt;/eval&amp;gt;      
      &amp;lt;eval token="tokIndex2"&amp;gt;if((now()-tokEarliestTime2) &amp;amp;lt;=86400,"yourRealTimeIndex","yourSummaryIndex")&amp;lt;/eval&amp;gt;
    &amp;lt;/done&amp;gt;
  &amp;lt;/search&amp;gt;  
  &amp;lt;fieldset submitButton="true"&amp;gt;
    &amp;lt;input type="dropdown" token="tokCriteria"&amp;gt;
      &amp;lt;label&amp;gt;Search Criteria&amp;lt;/label&amp;gt;
      &amp;lt;choice value="sender"&amp;gt;Sender&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="receiver"&amp;gt;Receipient&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="source_ip"&amp;gt;Source IP&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="message_id"&amp;gt;Message ID&amp;lt;/choice&amp;gt;
      &amp;lt;default&amp;gt;sender&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="tokSearch"&amp;gt;
      &amp;lt;label&amp;gt;Search Details&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="time" token="tokTime"&amp;gt;
      &amp;lt;label&amp;gt;Select Time&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;
        &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
      &amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;title&amp;gt;Option 1 : job.earliestTime and job.latestTime tokens&amp;lt;/title&amp;gt;
      &amp;lt;html&amp;gt;
        &amp;lt;div&amp;gt;
          &amp;lt;code&amp;gt; 
            tokLatestTimeString1: $tokLatestTimeString1$ &amp;amp;lt;br/&amp;amp;gt; 
            tokEarliestTimeString1: $tokEarliestTimeString1$ &amp;amp;lt;br/&amp;amp;gt;
            tokCurrentTimeString1: $tokCurrentTimeString1$ &amp;amp;lt;br/&amp;amp;gt;
            tokLatestTime1: $tokLatestTime1$ &amp;amp;lt;br/&amp;amp;gt; 
            tokEarliestTime1: $tokEarliestTime1$ &amp;amp;lt;br/&amp;amp;gt;
            tokCurrentTime1: $tokCurrentTime1$ &amp;amp;lt;br/&amp;amp;gt;
            duration1 (in secs): $duration1$ &amp;amp;lt;br/&amp;amp;gt;
            tokIndex1: $tokIndex1$
          &amp;lt;/code&amp;gt;
        &amp;lt;/div&amp;gt;
      &amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;title&amp;gt;Option 2 : addinfo command&amp;lt;/title&amp;gt;
      &amp;lt;html&amp;gt;
        &amp;lt;div&amp;gt;
         &amp;lt;code&amp;gt;
           tokLatestTimeString2: $tokLatestTimeString2$ &amp;amp;lt;br/&amp;amp;gt; 
           tokEarliestTimeString2: $tokEarliestTimeString2$ &amp;amp;lt;br/&amp;amp;gt;
           tokCurrentTimeString2: $tokCurrentTimeString2$ &amp;amp;lt;br/&amp;amp;gt;
           tokLatestTime2: $tokLatestTime2$ &amp;amp;lt;br/&amp;amp;gt; 
           tokEarliestTime2: $tokEarliestTime2$ &amp;amp;lt;br/&amp;amp;gt;
           tokCurrentTime2: $tokCurrentTime2$ &amp;amp;lt;br/&amp;amp;gt;
           duration2 (in secs): $duration2$ &amp;amp;lt;br/&amp;amp;gt;
           tokIndex2: $tokIndex2$
         &amp;lt;/code&amp;gt;
        &amp;lt;/div&amp;gt;
      &amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;    
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:00:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Running-one-of-two-searches-based-on-time-picker-selection/m-p/364413#M40574</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-09-29T16:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: Running one of two searches  based on time picker selection</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Running-one-of-two-searches-based-on-time-picker-selection/m-p/364414#M40575</link>
      <description>&lt;P&gt;@niketnilay, great answer, it deserves upvotes ! &lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2017 06:56:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Running-one-of-two-searches-based-on-time-picker-selection/m-p/364414#M40575</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2017-10-03T06:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: Running one of two searches  based on time picker selection</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Running-one-of-two-searches-based-on-time-picker-selection/m-p/364415#M40576</link>
      <description>&lt;P&gt;Thanks @inventsekar. As stated similar question like these have been asked several times before. So I wanted to document this &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;

&lt;P&gt;If will be fruitful effort if @adamblock2's problem is solved &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2017 07:31:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Running-one-of-two-searches-based-on-time-picker-selection/m-p/364415#M40576</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-10-03T07:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: Running one of two searches  based on time picker selection</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Running-one-of-two-searches-based-on-time-picker-selection/m-p/364416#M40577</link>
      <description>&lt;P&gt;I just attempted to copy your code for the first option so to create a test dashboard.  When I went to save the dashboard, I received the error "Encountered the following error while trying to save: Error parsing XML on line 16: StartTag: invalid element name"&lt;/P&gt;

&lt;P&gt;I believe line 16 corresponds to &lt;BR /&gt;
if((now()-tokEarliestTime1)&amp;lt;=86400,"yourRealTimeIndex","yourSummaryIndex")&lt;/P&gt;

&lt;P&gt;Thoughts?  Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2017 16:43:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Running-one-of-two-searches-based-on-time-picker-selection/m-p/364416#M40577</guid>
      <dc:creator>adamblock2</dc:creator>
      <dc:date>2017-10-03T16:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: Running one of two searches  based on time picker selection</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Running-one-of-two-searches-based-on-time-picker-selection/m-p/364417#M40578</link>
      <description>&lt;P&gt;@niketnilay - Awesome answer.  Change &lt;CODE&gt;&amp;lt;&lt;/CODE&gt; to &lt;CODE&gt;&amp;amp;lt;&lt;/CODE&gt; and &lt;CODE&gt;&amp;gt;&lt;/CODE&gt; to &lt;CODE&gt;&amp;amp;gt;&lt;/CODE&gt; when used as a literal or comparison operator in the XML.  (in &lt;CODE&gt;&amp;lt;=&lt;/CODE&gt; on lines 16 and 33)&lt;/P&gt;

&lt;P&gt;@adamblock2 - FYI.  The system is thinking that &lt;CODE&gt;&amp;lt;=&lt;/CODE&gt; is the start of an element tag &lt;CODE&gt;&amp;lt;SomeWeirdName ThatStartsWith "=" AndGoesOn NearlyForever&amp;gt;&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2017 15:52:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Running-one-of-two-searches-based-on-time-picker-selection/m-p/364417#M40578</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-10-05T15:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: Running one of two searches  based on time picker selection</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Running-one-of-two-searches-based-on-time-picker-selection/m-p/364418#M40579</link>
      <description>&lt;P&gt;Please use &amp;amp;lt;=86400. While pasting as code here on Splunk Answers it got converted to &lt;STRONG&gt;&amp;lt;=&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;I have updated in the answer. Please try out and confirm.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2017 15:56:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Running-one-of-two-searches-based-on-time-picker-selection/m-p/364418#M40579</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-10-05T15:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: Running one of two searches  based on time picker selection</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Running-one-of-two-searches-based-on-time-picker-selection/m-p/364419#M40580</link>
      <description>&lt;P&gt;Thanks @DalJeanis. As always &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I had HTML escaped characters in my answer. I think it got converted on Splunk Answers here before converting to code. I have corrected the same.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2017 16:05:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Running-one-of-two-searches-based-on-time-picker-selection/m-p/364419#M40580</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-10-05T16:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: Running one of two searches  based on time picker selection</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Running-one-of-two-searches-based-on-time-picker-selection/m-p/364420#M40581</link>
      <description>&lt;P&gt;@niketnilay - the interface is being opinionated.  In the &lt;CODE&gt;&amp;lt;code&amp;gt;&lt;/CODE&gt; sections, it has changed your &lt;CODE&gt;&amp;lt;br\&amp;gt;&lt;/CODE&gt; to &lt;CODE&gt;&amp;amp;lt;br\&amp;amp;gt;&lt;/CODE&gt; and won't let it be edited back.  &lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2017 17:45:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Running-one-of-two-searches-based-on-time-picker-selection/m-p/364420#M40581</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-10-05T17:45:01Z</dc:date>
    </item>
    <item>
      <title>Re: Running one of two searches  based on time picker selection</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Running-one-of-two-searches-based-on-time-picker-selection/m-p/364421#M40582</link>
      <description>&lt;P&gt;Yes... true... I have seen that before as well. Could not help it. Maybe mentioning in the answer itself is better.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 07:33:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Running-one-of-two-searches-based-on-time-picker-selection/m-p/364421#M40582</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-10-06T07:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: Running one of two searches  based on time picker selection</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Running-one-of-two-searches-based-on-time-picker-selection/m-p/364422#M40583</link>
      <description>&lt;P&gt;I apologize for the delayed response, but I have been out of the office for a number of days.  I re-tried the example above, and it worked without issue.&lt;/P&gt;

&lt;P&gt;My next question is the actual search that I am submitting.  Should I be replacing "yourRealTimeIndex","yourSummaryIndex" with the actual searches?  If yes, I am concerned that I have done something wrong, as the form does not appear to submit and the query doesn't run.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;eval token="tokIndex2"&amp;gt;if((now()-tokEarliestTime2) &amp;amp;lt;=86400,"index=mail eventtype=pps_filter | stats max(_time) AS _time, values(delivery_status) AS delivery_status, values(subject) AS subject, values(from) AS from, values(rcpt) AS to, values(sender_domain) AS sender_domain, values(hops_ip) AS infr_ip, values(Country) AS country, values(file_name) AS file_name, values(message_id) AS message_id by internal_message_id, host | fields - _raw | fields + _time, delivery_status, subject, from, to, sender_domain, infr_ip, country, file_name, message_id, internal_message_id, host| mvexpand file_name | search $i_criteria$=$s_value|s$ AND delivery_status=$d_status$| iplocation infr_ip | rename Country AS country | table _time, delivery_status, subject, from, to, sender_domain, infr_ip, country, file_name, message_id, internal_message_id | sort _time","index=summary report=proofpoint_daily_summary | mvexpand file_name | search $i_criteria$=$s_value|s$ AND delivery_status=$d_status$| iplocation infr_ip | rename Country AS country| eval eventtime=strftime(eventtime, "%x, %X") | table eventtime, delivery_status, subject, from, to, sender_domain, infr_ip, country, file_name, message_id, internal_message_id | sort eventtime") &amp;lt;/eval&amp;gt;
.
.
.
.
&amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;title&amp;gt;Search Messages&amp;lt;/title&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;$tokIndex2$&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;$i_time.earliest$&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;$i_time.latest$&amp;lt;/latest&amp;gt;
          &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="count"&amp;gt;10&amp;lt;/option&amp;gt;
        &amp;lt;option name="dataOverlayMode"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;cell&amp;lt;/option&amp;gt;
        &amp;lt;option name="percentagesRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="rowNumbers"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="totalsRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="wrap"&amp;gt;true&amp;lt;/option&amp;gt;
    &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Oct 2017 20:58:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Running-one-of-two-searches-based-on-time-picker-selection/m-p/364422#M40583</guid>
      <dc:creator>adamblock2</dc:creator>
      <dc:date>2017-10-17T20:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: Running one of two searches  based on time picker selection</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Running-one-of-two-searches-based-on-time-picker-selection/m-p/364423#M40584</link>
      <description>&lt;P&gt;The token values in the search are set in dropdown inputs which are submitted.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 20:59:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Running-one-of-two-searches-based-on-time-picker-selection/m-p/364423#M40584</guid>
      <dc:creator>adamblock2</dc:creator>
      <dc:date>2017-10-17T20:59:40Z</dc:date>
    </item>
  </channel>
</rss>

