<?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 Why would a time filter working in search but not in the dashboard? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-would-a-time-filter-working-in-search-but-not-in-the/m-p/393552#M114444</link>
    <description>&lt;P&gt;I built a dashboard and am trying to include a time filter on Purchase Date and not the default _time field. At first I tried removing the _time field and renaming PurDate as _time but that did not work. &lt;/P&gt;

&lt;P&gt;Then I added the following bit of code and I was able to filter results in search but it does not work in the dashboard. &lt;BR /&gt;
Why won't my dashboard update when I change the time filter but does change in search?&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| search &lt;BR /&gt;
    [| makeresults &lt;BR /&gt;
    | addinfo &lt;BR /&gt;
    | eval info_max_time=if(info_max_time=="+Infinity", now(), info_max_time) &lt;BR /&gt;
    | eval foo="PurDate&amp;gt;=".info_min_time." AND PurDate&amp;lt;".info_max_time &lt;BR /&gt;
    | table foo &lt;BR /&gt;
    | rename foo as search]&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Here is the source code for one of the pannels&lt;BR /&gt;
`&lt;BR /&gt;
      &lt;LABEL&gt;Customer Purchase&lt;/LABEL&gt;&lt;BR /&gt;
      &lt;DEFAULT&gt;&lt;BR /&gt;
        &lt;EARLIEST&gt;-24h@h&lt;/EARLIEST&gt;&lt;BR /&gt;
        &lt;LATEST&gt;now&lt;/LATEST&gt;&lt;BR /&gt;
      &lt;/DEFAULT&gt;&lt;BR /&gt;
    &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;panel&amp;gt;
  &amp;lt;title&amp;gt;License Status&amp;lt;/title&amp;gt;
  &amp;lt;chart&amp;gt;
    &amp;lt;search&amp;gt;
      &amp;lt;query&amp;gt;| from inputlookup:"customer.csv" 
                         | where (Region="NW") AND (IsActive="True")
                         | eval productName=split("Train##Car##Truck##Bike##Scooter","##") 
                               | mvexpand productName
                         | lookup Purchases.csv customerID productName OUTPUT PurDate
                         | eval PurDate=strptime(FirstPurDate,"%Y-%m-%d")
                         | search 
                             [| makeresults 
                             | addinfo 
                             | eval info_max_time=if(info_max_time=="+Infinity", now(), info_max_time) 
                             | eval foo="FirstPurDate&amp;gt;=".info_min_time." AND PurDate&amp;lt;".info_max_time 
                             | table foo 
                             | rename foo as search]`
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 06 Aug 2018 20:36:44 GMT</pubDate>
    <dc:creator>cromm</dc:creator>
    <dc:date>2018-08-06T20:36:44Z</dc:date>
    <item>
      <title>Why would a time filter working in search but not in the dashboard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-would-a-time-filter-working-in-search-but-not-in-the/m-p/393552#M114444</link>
      <description>&lt;P&gt;I built a dashboard and am trying to include a time filter on Purchase Date and not the default _time field. At first I tried removing the _time field and renaming PurDate as _time but that did not work. &lt;/P&gt;

&lt;P&gt;Then I added the following bit of code and I was able to filter results in search but it does not work in the dashboard. &lt;BR /&gt;
Why won't my dashboard update when I change the time filter but does change in search?&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| search &lt;BR /&gt;
    [| makeresults &lt;BR /&gt;
    | addinfo &lt;BR /&gt;
    | eval info_max_time=if(info_max_time=="+Infinity", now(), info_max_time) &lt;BR /&gt;
    | eval foo="PurDate&amp;gt;=".info_min_time." AND PurDate&amp;lt;".info_max_time &lt;BR /&gt;
    | table foo &lt;BR /&gt;
    | rename foo as search]&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Here is the source code for one of the pannels&lt;BR /&gt;
`&lt;BR /&gt;
      &lt;LABEL&gt;Customer Purchase&lt;/LABEL&gt;&lt;BR /&gt;
      &lt;DEFAULT&gt;&lt;BR /&gt;
        &lt;EARLIEST&gt;-24h@h&lt;/EARLIEST&gt;&lt;BR /&gt;
        &lt;LATEST&gt;now&lt;/LATEST&gt;&lt;BR /&gt;
      &lt;/DEFAULT&gt;&lt;BR /&gt;
    &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;panel&amp;gt;
  &amp;lt;title&amp;gt;License Status&amp;lt;/title&amp;gt;
  &amp;lt;chart&amp;gt;
    &amp;lt;search&amp;gt;
      &amp;lt;query&amp;gt;| from inputlookup:"customer.csv" 
                         | where (Region="NW") AND (IsActive="True")
                         | eval productName=split("Train##Car##Truck##Bike##Scooter","##") 
                               | mvexpand productName
                         | lookup Purchases.csv customerID productName OUTPUT PurDate
                         | eval PurDate=strptime(FirstPurDate,"%Y-%m-%d")
                         | search 
                             [| makeresults 
                             | addinfo 
                             | eval info_max_time=if(info_max_time=="+Infinity", now(), info_max_time) 
                             | eval foo="FirstPurDate&amp;gt;=".info_min_time." AND PurDate&amp;lt;".info_max_time 
                             | table foo 
                             | rename foo as search]`
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Aug 2018 20:36:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-would-a-time-filter-working-in-search-but-not-in-the/m-p/393552#M114444</guid>
      <dc:creator>cromm</dc:creator>
      <dc:date>2018-08-06T20:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: Why would a time filter working in search but not in the dashboard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-would-a-time-filter-working-in-search-but-not-in-the/m-p/393553#M114445</link>
      <description>&lt;P&gt;What was the time range used when you ran this in search page?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2018 21:08:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-would-a-time-filter-working-in-search-but-not-in-the/m-p/393553#M114445</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-08-06T21:08:26Z</dc:date>
    </item>
    <item>
      <title>Re: Why would a time filter working in search but not in the dashboard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-would-a-time-filter-working-in-search-but-not-in-the/m-p/393554#M114446</link>
      <description>&lt;P&gt;I tried a few different options like date ranges (ex. 05/01/2018 through today) and presets (ex. current fiscal year). they all worked in the search but the dashboard would not change from what I last did in the search&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2018 21:30:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-would-a-time-filter-working-in-search-but-not-in-the/m-p/393554#M114446</guid>
      <dc:creator>cromm</dc:creator>
      <dc:date>2018-08-06T21:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: Why would a time filter working in search but not in the dashboard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-would-a-time-filter-working-in-search-but-not-in-the/m-p/393555#M114447</link>
      <description>&lt;P&gt;Hello @cromm,&lt;/P&gt;

&lt;P&gt;I think you should try using &lt;CODE&gt;&amp;amp;lt;&lt;/CODE&gt; and &lt;CODE&gt;&amp;amp;gt;&lt;/CODE&gt; instead if &lt;CODE&gt;&amp;lt;&lt;/CODE&gt; and &lt;CODE&gt;&amp;gt;&lt;/CODE&gt; in your panel code.&lt;BR /&gt;
Can you please try this?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Aug 2018 13:59:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-would-a-time-filter-working-in-search-but-not-in-the/m-p/393555#M114447</guid>
      <dc:creator>poete</dc:creator>
      <dc:date>2018-08-07T13:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: Why would a time filter working in search but not in the dashboard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-would-a-time-filter-working-in-search-but-not-in-the/m-p/393556#M114448</link>
      <description>&lt;P&gt;1) As @poete suggested, you need to use &lt;CODE&gt;&amp;amp;gt;&lt;/CODE&gt; and &lt;CODE&gt;&amp;amp;lt;&lt;/CODE&gt; in the panel code for &lt;CODE&gt;&amp;gt;&lt;/CODE&gt; and &lt;CODE&gt;&amp;lt;&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;2) Do not assign a value to &lt;CODE&gt;info_max_time&lt;/CODE&gt; - that field is set at the search level.  Use another variable name.&lt;/P&gt;

&lt;P&gt;3) Make sure that your underlying variables (FirstPurDate) are stored in epoch format.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Aug 2018 14:18:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-would-a-time-filter-working-in-search-but-not-in-the/m-p/393556#M114448</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2018-08-07T14:18:07Z</dc:date>
    </item>
  </channel>
</rss>

