<?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: Dropdown Condition - Match regex value on change in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dropdown-Condition-Match-regex-value-on-change/m-p/186097#M11505</link>
    <description>&lt;P&gt;Yeah, this feature came new with 6.3... nice find!&lt;/P&gt;</description>
    <pubDate>Mon, 21 Dec 2015 11:33:45 GMT</pubDate>
    <dc:creator>jeffland</dc:creator>
    <dc:date>2015-12-21T11:33:45Z</dc:date>
    <item>
      <title>Dropdown Condition - Match regex value on change</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dropdown-Condition-Match-regex-value-on-change/m-p/186092#M11500</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;

&lt;P&gt;I have a dashboard for which I want to set a value based on whether a string matches a smoke test. This is the XML I have:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;change&amp;gt;
    &amp;lt;condition value="*smoke*"&amp;gt;
        &amp;lt;set token="testUrl"&amp;gt;http://someUrl&amp;lt;/set&amp;gt;
    &amp;lt;/condition&amp;gt;
    &amp;lt;condition value="*"&amp;gt;
        &amp;lt;set token="testUrl"&amp;gt;http://someOtherUrl&amp;lt;/set&amp;gt;
    &amp;lt;/condition&amp;gt;
&amp;lt;/change&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The change condition doesn't seem to respect asterisk wildcards though. It's always directing to &lt;A href="http://someOtherUrl"&gt;http://someOtherUrl&lt;/A&gt;. Is there a way to get this to work?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2015 15:55:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dropdown-Condition-Match-regex-value-on-change/m-p/186092#M11500</guid>
      <dc:creator>bruceclarke</dc:creator>
      <dc:date>2015-07-01T15:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: Dropdown Condition - Match regex value on change</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dropdown-Condition-Match-regex-value-on-change/m-p/186093#M11501</link>
      <description>&lt;H2&gt;Update: this is possible in 6.3+, see accepted answer above.&lt;/H2&gt;

&lt;P&gt;The &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.3/Viz/PanelreferenceforSimplifiedXML#condition_.28input.29"&gt;reference&lt;/A&gt; doesn't say anything about wildcards, it only specifies &lt;CODE&gt;*&lt;/CODE&gt; as a setting to apply this to every input &lt;CODE&gt;value&lt;/CODE&gt; element, i.e. that this condition is independent of the value that the input has changed to (which would be the same as not having the condition at all).  Therefore, it's no wonder that your code above always responds with someOtherUrl, as the second condition is always met.&lt;/P&gt;

&lt;P&gt;I doubt the conditions are tried in the order they appear and stop when a match has been found, which would be a &lt;CODE&gt;case&lt;/CODE&gt;-like behavior; I would expect all conditions to be tried and if the result a condition produces overlaps with that of a previously tried condition (as with the token "testUrl" in your case), I would expect it to overwrite the previously set value. But this is only speculation at the moment, I will see and try if I can figure that out.&lt;/P&gt;

&lt;P&gt;In the meantime, have you tried using two exclusive, more excplicit values, something like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;change&amp;gt;
    &amp;lt;condition value="*smokeA*"&amp;gt;
        &amp;lt;set token="testUrl"&amp;gt;http://someUrl&amp;lt;/set&amp;gt;
    &amp;lt;/condition&amp;gt;
    &amp;lt;condition value="*smokeB*"&amp;gt;
        &amp;lt;set token="testUrl"&amp;gt;http://someOtherUrl&amp;lt;/set&amp;gt;
    &amp;lt;/condition&amp;gt;
&amp;lt;/change&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm not sure about this, but if those values take wildcards, this might work because they only ever apply one at a time.&lt;/P&gt;

&lt;P&gt;In any case, you should be able to do what you want with Javascript: listen to a change event on the input, check the value for your condition, and set the token accordingly.&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;UPDATE: In fact, conditions do behave case-like. If you let them check something explicitly, i.e. full text match, only the first condition's action is applied, so you can use that condition with value=* as the last condtion, after all others did not match, kind of like the 1=1 condition in a case statement.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jul 2015 09:32:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dropdown-Condition-Match-regex-value-on-change/m-p/186093#M11501</guid>
      <dc:creator>jeffland</dc:creator>
      <dc:date>2015-07-02T09:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: Dropdown Condition - Match regex value on change</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dropdown-Condition-Match-regex-value-on-change/m-p/186094#M11502</link>
      <description>&lt;P&gt;From what I can tell, the conditional isn't respecting wildcards. My guess is that the &lt;CODE&gt;value="*"&lt;/CODE&gt; option is a special case that Splunk handles. It's not indicative of it accepting wildcards.&lt;/P&gt;

&lt;P&gt;Unfortunately this means I'll have to edit the javascript or find a different workaround. But let me know if anyone else finds a good way to do this!&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jul 2015 15:47:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dropdown-Condition-Match-regex-value-on-change/m-p/186094#M11502</guid>
      <dc:creator>bruceclarke</dc:creator>
      <dc:date>2015-07-02T15:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: Dropdown Condition - Match regex value on change</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dropdown-Condition-Match-regex-value-on-change/m-p/186095#M11503</link>
      <description>&lt;P&gt;Yes, it would seem that unfortunately, wildcards are not supported in these value condition checks.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jul 2015 04:57:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dropdown-Condition-Match-regex-value-on-change/m-p/186095#M11503</guid>
      <dc:creator>jeffland</dc:creator>
      <dc:date>2015-07-03T04:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: Dropdown Condition - Match regex value on change</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dropdown-Condition-Match-regex-value-on-change/m-p/186096#M11504</link>
      <description>&lt;P&gt;In 6.3 I put the following xml together that performs a test like you describe:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;form&amp;gt;
     &amp;lt;label&amp;gt;Test_smoke&amp;lt;/label&amp;gt;
      &amp;lt;fieldset&amp;gt;
       &amp;lt;input type="text" token="field100"&amp;gt;
        &amp;lt;change&amp;gt;
         &amp;lt;condition match="match(value, &amp;amp;quot;smoke&amp;amp;quot;)"&amp;gt;
          &amp;lt;set token="test-result"&amp;gt;Is_smoke&amp;lt;/set&amp;gt;
         &amp;lt;/condition&amp;gt;
         &amp;lt;condition&amp;gt;
          &amp;lt;set token="test-result"&amp;gt;Is_NOT_smoke&amp;lt;/set&amp;gt;
         &amp;lt;/condition&amp;gt;
        &amp;lt;/change&amp;gt;
       &amp;lt;/input&amp;gt;
      &amp;lt;/fieldset&amp;gt;
      &amp;lt;row&amp;gt;
       &amp;lt;panel&amp;gt;
        &amp;lt;table&amp;gt;
         &amp;lt;title&amp;gt;Test-Result=$test-result$ ------ field=$field100$ &amp;lt;/title&amp;gt;
          &amp;lt;search&amp;gt;
           &amp;lt;query&amp;gt;index=**&amp;lt;/query&amp;gt;
           &amp;lt;earliest&amp;gt;0&amp;lt;/earliest&amp;gt;
          &amp;lt;/search&amp;gt;
         &amp;lt;/table&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, 06 Oct 2015 18:26:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dropdown-Condition-Match-regex-value-on-change/m-p/186096#M11504</guid>
      <dc:creator>mydog8it</dc:creator>
      <dc:date>2015-10-06T18:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: Dropdown Condition - Match regex value on change</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dropdown-Condition-Match-regex-value-on-change/m-p/186097#M11505</link>
      <description>&lt;P&gt;Yeah, this feature came new with 6.3... nice find!&lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2015 11:33:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dropdown-Condition-Match-regex-value-on-change/m-p/186097#M11505</guid>
      <dc:creator>jeffland</dc:creator>
      <dc:date>2015-12-21T11:33:45Z</dc:date>
    </item>
    <item>
      <title>Re: Dropdown Condition - Match regex value on change</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dropdown-Condition-Match-regex-value-on-change/m-p/186098#M11506</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Can you please try this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;change&amp;gt;
         &amp;lt;condition match="like($value$,&amp;amp;quot;%smoke%&amp;amp;quot;)"&amp;gt;
             &amp;lt;set token="testUrl"&amp;gt;http://someUrl&amp;lt;/set&amp;gt;
         &amp;lt;/condition&amp;gt;
         &amp;lt;condition value="*"&amp;gt;
             &amp;lt;set token="testUrl"&amp;gt;http://someOtherUrl&amp;lt;/set&amp;gt;
         &amp;lt;/condition&amp;gt;
     &amp;lt;/change&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here I have used &lt;CODE&gt;like()&lt;/CODE&gt; in match.&lt;/P&gt;

&lt;P&gt;eg,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;like($value$,&amp;amp;quot;%smoke%&amp;amp;quot;)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Happy Splunking&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2017 09:13:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dropdown-Condition-Match-regex-value-on-change/m-p/186098#M11506</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2017-11-21T09:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: Dropdown Condition - Match regex value on change</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dropdown-Condition-Match-regex-value-on-change/m-p/186099#M11507</link>
      <description>&lt;P&gt;Hi All,&lt;BR /&gt;
I am also looking for this issue.&lt;BR /&gt;
am using like this what did you gave answers.&lt;/P&gt;

&lt;P&gt;ALL&lt;BR /&gt;
      &lt;CHANGE&gt;&lt;BR /&gt;
        &lt;CONDITION match="match(value, &amp;quot;%&amp;quot;)"&gt;&lt;BR /&gt;
          &lt;SET token="zoneall"&gt;True&lt;/SET&gt;&lt;BR /&gt;
          &lt;UNSET token="zonesingle"&gt;&lt;/UNSET&gt;&lt;BR /&gt;
        &lt;/CONDITION&gt;&lt;BR /&gt;
        &lt;CONDITION&gt;&lt;BR /&gt;
          &lt;SET token="zonesingle"&gt;True&lt;/SET&gt;&lt;BR /&gt;
          &lt;UNSET token="zoneall"&gt;&lt;/UNSET&gt;&lt;BR /&gt;
        &lt;/CONDITION&gt;&lt;BR /&gt;
      &lt;/CHANGE&gt;&lt;/P&gt;

&lt;P&gt;But is is not working for me am using splunk 6.6.1&lt;/P&gt;

&lt;P&gt;It is working this code &lt;/P&gt;

&lt;P&gt;ALL&lt;BR /&gt;
      &lt;STRONG&gt;&lt;CHANGE&gt;&lt;BR /&gt;
        &lt;CONDITION value="%"&gt;&lt;BR /&gt;
          &lt;SET token="zoneall"&gt;True&lt;/SET&gt;&lt;BR /&gt;
          &lt;UNSET token="zonesingle"&gt;&lt;/UNSET&gt;&lt;BR /&gt;
        &lt;/CONDITION&gt;&lt;BR /&gt;
        &lt;CONDITION&gt;&lt;BR /&gt;
          &lt;SET token="zonesingle"&gt;True&lt;/SET&gt;&lt;BR /&gt;
          &lt;UNSET token="zoneall"&gt;&lt;/UNSET&gt;&lt;BR /&gt;
        &lt;/CONDITION&gt;&lt;BR /&gt;
      &lt;/CHANGE&gt;&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;It is ok but what my problem is ...&lt;BR /&gt;
This code working good in desktop but it is not working in mobiles.&lt;BR /&gt;
please help for this .&lt;BR /&gt;
my question link;  &lt;A href="https://answers.splunk.com/answers/592116/related-to-tokens-in-multiselect.html"&gt;link text&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 07:42:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dropdown-Condition-Match-regex-value-on-change/m-p/186099#M11507</guid>
      <dc:creator>harishalipaka</dc:creator>
      <dc:date>2017-11-30T07:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: Dropdown Condition - Match regex value on change</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dropdown-Condition-Match-regex-value-on-change/m-p/186100#M11508</link>
      <description>&lt;P&gt;hi am also searching for this type of problem please help for this .my question links are::&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/592116/related-to-tokens-in-multiselect.html"&gt;https://answers.splunk.com/answers/592116/related-to-tokens-in-multiselect.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/593597/developing-a-splunk-app-and-it-doesnt-work-on-mobi.html"&gt;https://answers.splunk.com/answers/593597/developing-a-splunk-app-and-it-doesnt-work-on-mobi.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 07:46:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dropdown-Condition-Match-regex-value-on-change/m-p/186100#M11508</guid>
      <dc:creator>harishalipaka</dc:creator>
      <dc:date>2017-11-30T07:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: Dropdown Condition - Match regex value on change</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dropdown-Condition-Match-regex-value-on-change/m-p/186101#M11509</link>
      <description>&lt;P&gt;hi am also searching for this type of problem please help for this .my question links are::&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/592116/related-to-tokens-in-multiselect.html"&gt;https://answers.splunk.com/answers/592116/related-to-tokens-in-multiselect.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/593597/developing-a-splunk-app-and-it-doesnt-work-on-mobi.html"&gt;https://answers.splunk.com/answers/593597/developing-a-splunk-app-and-it-doesnt-work-on-mobi.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 07:57:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dropdown-Condition-Match-regex-value-on-change/m-p/186101#M11509</guid>
      <dc:creator>harishalipaka</dc:creator>
      <dc:date>2017-11-30T07:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: Dropdown Condition - Match regex value on change</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dropdown-Condition-Match-regex-value-on-change/m-p/186102#M11510</link>
      <description>&lt;P&gt;this worked for me&lt;/P&gt;</description>
      <pubDate>Mon, 10 Dec 2018 17:32:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dropdown-Condition-Match-regex-value-on-change/m-p/186102#M11510</guid>
      <dc:creator>rajpannala</dc:creator>
      <dc:date>2018-12-10T17:32:06Z</dc:date>
    </item>
  </channel>
</rss>

