<?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: Display panel based on the value of a search? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-display-panel-based-on-the-value-of-a-search/m-p/514093#M34323</link>
    <description>&lt;P&gt;Thank you for the response.&lt;/P&gt;&lt;P&gt;As mentioned, the search that builds the values runs on load and then identifies if it is prior to 1:30pm, or 4pm. I appreciate the depends element relies on the prescence of a token, I'm wondering if you can trigger the panel display based on the value of the token present??&lt;/P&gt;</description>
    <pubDate>Fri, 14 Aug 2020 13:06:28 GMT</pubDate>
    <dc:creator>Barty</dc:creator>
    <dc:date>2020-08-14T13:06:28Z</dc:date>
    <item>
      <title>How to display panel based on the value of a search?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-display-panel-based-on-the-value-of-a-search/m-p/514072#M34320</link>
      <description>&lt;P&gt;Good morning all,&lt;/P&gt;
&lt;P&gt;I'm hoping someone may be able to assist me quickly and easily. I have a dashboard that shows a number of panels that return a status of batch jobs. Thing is, these batch jobs only run at 1:30pm and 4pm. As such, to make the dashboard a little more dynamic, I'd like to hide the panels for 1:30pm prior to the time being 1:30pm and likewise for 4pm.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a hidden search that calculates current date and time, then I create two fields called time_check1 and time_check2. These two fields have a value of Yes or No depending on whether time_check1 is before 1:30pm (Yes, No) and likewise the second checks if it is before 4pm.&lt;/P&gt;
&lt;P&gt;Now, what I want to do is only show the 1:30pm panels when time_check1 is = Yes, and the same again for 4pm panels when time_check2 is Yes. I have done a fair amount of searching through here and can see lots of questions about utilising dropdowns and inputs for this, but mine is a static hidden search that I simply need to display the panels when criteria is met (the value of Yes).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Would anyone please be able to assist me? I'm sure there must be something along the lines of&amp;nbsp;&amp;lt;panel depends="$time_check1$=YES"&amp;gt; or similar?&lt;/P&gt;
&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 15:11:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-display-panel-based-on-the-value-of-a-search/m-p/514072#M34320</guid>
      <dc:creator>Barty</dc:creator>
      <dc:date>2022-07-29T15:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: Display panel based on the value of a search?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-display-panel-based-on-the-value-of-a-search/m-p/514088#M34322</link>
      <description>&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;depends&lt;/FONT&gt; attribute tests for the presence of a token, not its value.&amp;nbsp; If you can get your tokens to be present only when the panel should be seen then you can use&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;panel depends=$time_check1$&amp;gt;
...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 13:14:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-display-panel-based-on-the-value-of-a-search/m-p/514088#M34322</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-08-14T13:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: Display panel based on the value of a search?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-display-panel-based-on-the-value-of-a-search/m-p/514093#M34323</link>
      <description>&lt;P&gt;Thank you for the response.&lt;/P&gt;&lt;P&gt;As mentioned, the search that builds the values runs on load and then identifies if it is prior to 1:30pm, or 4pm. I appreciate the depends element relies on the prescence of a token, I'm wondering if you can trigger the panel display based on the value of the token present??&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 13:06:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-display-panel-based-on-the-value-of-a-search/m-p/514093#M34323</guid>
      <dc:creator>Barty</dc:creator>
      <dc:date>2020-08-14T13:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: Display panel based on the value of a search?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-display-panel-based-on-the-value-of-a-search/m-p/514098#M34325</link>
      <description>As I said, the depends attribute tests for the presence of a token, not its value. You can use conditions, however, to test a token value and set a depends token. See &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.5/Viz/ContextualDrilldown#Configure_conditional_behavior" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.5/Viz/ContextualDrilldown#Configure_conditional_behavior&lt;/A&gt; .</description>
      <pubDate>Fri, 14 Aug 2020 13:19:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-display-panel-based-on-the-value-of-a-search/m-p/514098#M34325</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-08-14T13:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: Display panel based on the value of a search?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-display-panel-based-on-the-value-of-a-search/m-p/514105#M34330</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/72782"&gt;@Barty&lt;/a&gt;&amp;nbsp;you would need to take care of token assignment in your independent search event handler itself. How depends and rejects works is based on whether the token is set or it is null. It does not work based on what value does the token have.&lt;/P&gt;&lt;P&gt;Following is a run anywhere search that should set the required tokens. PS I am setting a third token for other time which do not match either of the time criteria you mentioned.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;  &amp;lt;search&amp;gt;
    &amp;lt;query&amp;gt;| makeresults
| eval HourMinute=strftime(now(),"%H:%M:%S")
| eval time=case(HourMinute&amp;amp;gt;="13:30:00" AND HourMinute&amp;amp;lt;"16:00:59","Afternoon",HourMinute&amp;amp;gt;="16:00:00" AND HourMinute&amp;amp;lt;"23:59:59", "Evening",true(),"Morning")
    &amp;lt;/query&amp;gt;
    &amp;lt;earliest&amp;gt;-1s&amp;lt;/earliest&amp;gt;
    &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
    &amp;lt;done&amp;gt;
      &amp;lt;condition match="$result.time$==&amp;amp;quot;Afternoon&amp;amp;quot;"&amp;gt;
        &amp;lt;set token="time"&amp;gt;$result.time$&amp;lt;/set&amp;gt;
        &amp;lt;set token="showAfternoonPanel"&amp;gt;true&amp;lt;/set&amp;gt;
        &amp;lt;unset token="showEveningPanel"&amp;gt;&amp;lt;/unset&amp;gt;
        &amp;lt;unset token="showMorningPanel"&amp;gt;&amp;lt;/unset&amp;gt;
      &amp;lt;/condition&amp;gt;
      &amp;lt;condition match="$result.time$==&amp;amp;quot;Evening&amp;amp;quot;"&amp;gt;
        &amp;lt;set token="time"&amp;gt;$result.time$&amp;lt;/set&amp;gt;
        &amp;lt;unset token="showAfternoonPanel"&amp;gt;&amp;lt;/unset&amp;gt;
        &amp;lt;set token="showEveningPanel"&amp;gt;true&amp;lt;/set&amp;gt;
        &amp;lt;unset token="showMorningPanel"&amp;gt;&amp;lt;/unset&amp;gt;
      &amp;lt;/condition&amp;gt;
      &amp;lt;condition&amp;gt;
        &amp;lt;set token="time"&amp;gt;$result.time$&amp;lt;/set&amp;gt;
        &amp;lt;unset token="showAfternoonPanel"&amp;gt;&amp;lt;/unset&amp;gt;
        &amp;lt;unset token="showEveningPanel"&amp;gt;&amp;lt;/unset&amp;gt;
        &amp;lt;set token="showMorningPanel"&amp;gt;true&amp;lt;/set&amp;gt;
      &amp;lt;/condition&amp;gt;
    &amp;lt;/done&amp;gt;
  &amp;lt;/search&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Following is the Panel code for you to test the above code...&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;  &amp;lt;row&amp;gt;
    &amp;lt;panel depends="$showAfternoonPanel$"&amp;gt;
      &amp;lt;html&amp;gt;$time$ Panel&amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
    &amp;lt;panel depends="$showEveningPanel$"&amp;gt;
      &amp;lt;html&amp;gt;$time$ Panel&amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
    &amp;lt;panel depends="$showMorningPanel$"&amp;gt;
      &amp;lt;html&amp;gt;$time$ Panel&amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 14 Aug 2020 13:44:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-display-panel-based-on-the-value-of-a-search/m-p/514105#M34330</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-08-14T13:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: Display panel based on the value of a search?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-display-panel-based-on-the-value-of-a-search/m-p/514635#M34384</link>
      <description>&lt;P&gt;Perfect!! Thank you so much for this&lt;/P&gt;</description>
      <pubDate>Tue, 18 Aug 2020 07:55:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-display-panel-based-on-the-value-of-a-search/m-p/514635#M34384</guid>
      <dc:creator>Barty</dc:creator>
      <dc:date>2020-08-18T07:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: Display panel based on the value of a search?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-display-panel-based-on-the-value-of-a-search/m-p/607546#M49864</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/201110"&gt;@niketn&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I show panel dynamically? In this example you manually set the result, but what if I want to display the panel based on the result of the search that was picked from dropdown?&lt;BR /&gt;&lt;BR /&gt;Scenario:&lt;BR /&gt;I have a dropdown with options: East, West, South and North. When i pick East from my dropdown and East populates in my panel, i'd like to show my panel. However if East is not populated in my search i want to hide the panel. Is there a way to do it dynamically?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 15:05:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-display-panel-based-on-the-value-of-a-search/m-p/607546#M49864</guid>
      <dc:creator>yvassilyeva</dc:creator>
      <dc:date>2022-07-29T15:05:21Z</dc:date>
    </item>
    <item>
      <title>Re: Display panel based on the value of a search?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-display-panel-based-on-the-value-of-a-search/m-p/607548#M49865</link>
      <description>&lt;P&gt;This is an old question with an accepted answer so it's unlikely many will see your question.&amp;nbsp; I suggest you post a new question.&lt;/P&gt;&lt;P&gt;BTW, niketnilay is no longer with us so there's no need to tag him.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 15:12:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-display-panel-based-on-the-value-of-a-search/m-p/607548#M49865</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-07-29T15:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: Display panel based on the value of a search?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-display-panel-based-on-the-value-of-a-search/m-p/607550#M49867</link>
      <description>&lt;P&gt;Thanks for the heads up!&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 15:16:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-display-panel-based-on-the-value-of-a-search/m-p/607550#M49867</guid>
      <dc:creator>yvassilyeva</dc:creator>
      <dc:date>2022-07-29T15:16:21Z</dc:date>
    </item>
  </channel>
</rss>

