<?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: Problem with Token condition match in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Problem-with-Token-condition-match/m-p/528890#M35897</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/194350"&gt;@llacoste&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You need to quote the right hand side of the condition, &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;true&lt;/FONT&gt;&lt;/STRONG&gt;, with&amp;nbsp;&amp;amp;quot; so it should be&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;search&amp;gt;
  &amp;lt;query&amp;gt;| makeresults |eval is_Valid=(if("Valid" == "Valid","true","false")). 
  &amp;lt;/query&amp;gt;
  &amp;lt;done&amp;gt;
    &amp;lt;condition match="'result.is_Valid'==&amp;amp;quot;true&amp;amp;quot;"&amp;gt;
      &amp;lt;set token="Display_Html"&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;</description>
    <pubDate>Tue, 10 Nov 2020 21:28:37 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2020-11-10T21:28:37Z</dc:date>
    <item>
      <title>Problem with Token condition match</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Problem-with-Token-condition-match/m-p/528860#M35890</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to set a token to display a part of my dashboard only if the value of one of the field I've got in my search is equal to a certain string.&lt;/P&gt;&lt;P&gt;Here is an example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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 is_Valid=(if("Valid" == "Valid","true","false"))&amp;lt;/query&amp;gt;
&amp;lt;done&amp;gt;
&amp;lt;condition match="'result.is_Valid'==true"&amp;gt;
&amp;lt;set token="Display_Html"&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, this condition doesn't seem to work. I can clearly see my makeresults command works in a search or even in the dashboard, but the condition + set token doesn't seem to work.&lt;BR /&gt;&lt;BR /&gt;Does anybody have got any idea what I'm doing wrong please?&lt;BR /&gt;&lt;BR /&gt;Thank you&lt;/P&gt;&lt;P&gt;Regards&amp;nbsp;&lt;/P&gt;&lt;P&gt;Laurent&lt;/P&gt;</description>
      <pubDate>Tue, 10 Nov 2020 17:57:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Problem-with-Token-condition-match/m-p/528860#M35890</guid>
      <dc:creator>llacoste</dc:creator>
      <dc:date>2020-11-10T17:57:36Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Token condition match</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Problem-with-Token-condition-match/m-p/528874#M35892</link>
      <description>&lt;P&gt;What version of Splunk are you using?&amp;nbsp; This code works find under 8.1.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;dashboard&amp;gt;
  &amp;lt;label&amp;gt;test2&amp;lt;/label&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;| makeresults |eval is_Valid=(if("Valid" == "Valid","true","false"))&amp;lt;/query&amp;gt;
          &amp;lt;done&amp;gt;
            &amp;lt;condition match="'result.is_Valid'==true"&amp;gt;
              &amp;lt;set token="Display_Html"&amp;gt;true&amp;lt;/set&amp;gt;
            &amp;lt;/condition&amp;gt;
          &amp;lt;/done&amp;gt;
        &amp;lt;/search&amp;gt;    
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 10 Nov 2020 19:14:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Problem-with-Token-condition-match/m-p/528874#M35892</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-11-10T19:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Token condition match</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Problem-with-Token-condition-match/m-p/528885#M35894</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your time. I am working with 7.3.5 (don't have the choice) and it did not seem to work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'll check in a separate test dashboard at work tomorrow and on a fresh install of v8.x tonight.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your time. Will let you know ASAP.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Nov 2020 20:26:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Problem-with-Token-condition-match/m-p/528885#M35894</guid>
      <dc:creator>llacoste</dc:creator>
      <dc:date>2020-11-10T20:26:51Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Token condition match</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Problem-with-Token-condition-match/m-p/528889#M35896</link>
      <description>&lt;P&gt;Just tried on v8.0.4.1 and it's still not working.&lt;/P&gt;&lt;P&gt;I manage to get that field is_OK populated but the second token in the condition doesn't get set.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Nov 2020 21:02:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Problem-with-Token-condition-match/m-p/528889#M35896</guid>
      <dc:creator>llacoste</dc:creator>
      <dc:date>2020-11-10T21:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Token condition match</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Problem-with-Token-condition-match/m-p/528890#M35897</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/194350"&gt;@llacoste&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You need to quote the right hand side of the condition, &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;true&lt;/FONT&gt;&lt;/STRONG&gt;, with&amp;nbsp;&amp;amp;quot; so it should be&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;search&amp;gt;
  &amp;lt;query&amp;gt;| makeresults |eval is_Valid=(if("Valid" == "Valid","true","false")). 
  &amp;lt;/query&amp;gt;
  &amp;lt;done&amp;gt;
    &amp;lt;condition match="'result.is_Valid'==&amp;amp;quot;true&amp;amp;quot;"&amp;gt;
      &amp;lt;set token="Display_Html"&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;</description>
      <pubDate>Tue, 10 Nov 2020 21:28:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Problem-with-Token-condition-match/m-p/528890#M35897</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2020-11-10T21:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Token condition match</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Problem-with-Token-condition-match/m-p/528951#M35906</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;So I had some play around this at work this morning and it seems if I'm using a test dashboard with nothing else on version 7.3.5, it does work.&lt;BR /&gt;&lt;BR /&gt;However as my other dashboard is more complex and one of the field I'm testing depends on another query, I guess that's the problem. Maybe Splunk is loading at the same time both queries and the condition is not possible as the first query is still not completed yet.&lt;BR /&gt;&lt;BR /&gt;I am using &amp;lt;done&amp;gt; tags on both queries which should make it work but it seems not.&lt;BR /&gt;I'm going to explore the idea of only triggering the second search only if the first one is completed.&lt;BR /&gt;&lt;BR /&gt;Thank you for your help&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp; at least you proved it should be working.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2020 11:01:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Problem-with-Token-condition-match/m-p/528951#M35906</guid>
      <dc:creator>llacoste</dc:creator>
      <dc:date>2020-11-11T11:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Token condition match</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Problem-with-Token-condition-match/m-p/528958#M35907</link>
      <description>&lt;P&gt;And finally I just managed to understand and make it work.&lt;BR /&gt;&lt;BR /&gt;I was testing the token on a &amp;lt;html&amp;gt;&amp;lt;h1&amp;gt;$Display_Html$&amp;lt;/h1&amp;gt;&amp;lt;/html&amp;gt; part of the dashboard, however this was loading before the search managed to finish and set the token.&lt;BR /&gt;&lt;BR /&gt;I used a depends="$Display_Html$" and now the panel only appears whenever the token had time to be set.&lt;BR /&gt;&lt;BR /&gt;Bottom line it must have been working for a while but couldn't see the token being set.&lt;BR /&gt;&lt;BR /&gt;Also the &amp;amp;quot; seems to make it work.&lt;BR /&gt;&lt;BR /&gt;Thank you again. Problem solved!&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2020 11:43:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Problem-with-Token-condition-match/m-p/528958#M35907</guid>
      <dc:creator>llacoste</dc:creator>
      <dc:date>2020-11-11T11:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Token condition match</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Problem-with-Token-condition-match/m-p/528973#M35909</link>
      <description>&lt;P&gt;If your problem is resolved, then please click the "Accept as Solution" button to help future readers.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2020 14:05:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Problem-with-Token-condition-match/m-p/528973#M35909</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-11-11T14:05:48Z</dc:date>
    </item>
  </channel>
</rss>

