<?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: &amp;lt;change&amp;gt; event firing before the user ever makes a change to the form input? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/lt-change-gt-event-firing-before-the-user-ever-makes-a-change-to/m-p/540670#M152971</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231659"&gt;@tonymaibox&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your condition has no match attribute, so it will match all events, including form initialization.&lt;/P&gt;&lt;P&gt;For example, foo_tok is cleared on init in this Simple XML:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;form&amp;gt;
  &amp;lt;init&amp;gt;
    &amp;lt;set token="foo_tok"&amp;gt;initialized&amp;lt;/set&amp;gt;
  &amp;lt;/init&amp;gt;
  &amp;lt;label&amp;gt;Test&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="multiselect" token="field1" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Sample Input&amp;lt;/label&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;count&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;count&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;| stats count&amp;lt;/query&amp;gt;
      &amp;lt;/search&amp;gt;
      &amp;lt;change&amp;gt;
        &amp;lt;condition&amp;gt;
          &amp;lt;unset token="foo_tok"&amp;gt;&amp;lt;/unset&amp;gt;
        &amp;lt;/condition&amp;gt;
      &amp;lt;/change&amp;gt;
      &amp;lt;delimiter&amp;gt; &amp;lt;/delimiter&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;$foo_tok$&amp;lt;/title&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;You can control when unset is invoked by adding constraints to the condition element:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;condition label="0"&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 20 Feb 2021 21:43:52 GMT</pubDate>
    <dc:creator>tscroggins</dc:creator>
    <dc:date>2021-02-20T21:43:52Z</dc:date>
    <item>
      <title>&lt;change&gt; event firing before the user ever makes a change to the form input?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/lt-change-gt-event-firing-before-the-user-ever-makes-a-change-to/m-p/540428#M152891</link>
      <description>&lt;P&gt;Hi all, hope all is well!&lt;BR /&gt;&lt;BR /&gt;I'm unsetting a token in the &amp;lt;change&amp;gt; block of a &amp;lt;query&amp;gt;. However, I'm finding that the &amp;lt;unset&amp;gt; event in the &amp;lt;change&amp;gt; block gets fired on initial load before the user ever makes a change to the input. Is this a bug?&lt;/P&gt;&lt;P&gt;Sample code:&lt;BR /&gt;&lt;BR /&gt;&amp;lt;input&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;search&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;query&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/query&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;change&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;condition&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;unset token="some_token"&amp;gt;&amp;lt;/unset&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/condition&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/change&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;/search&amp;gt;&lt;BR /&gt;&amp;lt;/input&amp;gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Feb 2021 18:38:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/lt-change-gt-event-firing-before-the-user-ever-makes-a-change-to/m-p/540428#M152891</guid>
      <dc:creator>tonymaibox</dc:creator>
      <dc:date>2021-02-18T18:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: &lt;change&gt; event firing before the user ever makes a change to the form input?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/lt-change-gt-event-firing-before-the-user-ever-makes-a-change-to/m-p/540670#M152971</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231659"&gt;@tonymaibox&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your condition has no match attribute, so it will match all events, including form initialization.&lt;/P&gt;&lt;P&gt;For example, foo_tok is cleared on init in this Simple XML:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;form&amp;gt;
  &amp;lt;init&amp;gt;
    &amp;lt;set token="foo_tok"&amp;gt;initialized&amp;lt;/set&amp;gt;
  &amp;lt;/init&amp;gt;
  &amp;lt;label&amp;gt;Test&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="multiselect" token="field1" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Sample Input&amp;lt;/label&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;count&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;count&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;| stats count&amp;lt;/query&amp;gt;
      &amp;lt;/search&amp;gt;
      &amp;lt;change&amp;gt;
        &amp;lt;condition&amp;gt;
          &amp;lt;unset token="foo_tok"&amp;gt;&amp;lt;/unset&amp;gt;
        &amp;lt;/condition&amp;gt;
      &amp;lt;/change&amp;gt;
      &amp;lt;delimiter&amp;gt; &amp;lt;/delimiter&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;$foo_tok$&amp;lt;/title&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;You can control when unset is invoked by adding constraints to the condition element:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;condition label="0"&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Feb 2021 21:43:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/lt-change-gt-event-firing-before-the-user-ever-makes-a-change-to/m-p/540670#M152971</guid>
      <dc:creator>tscroggins</dc:creator>
      <dc:date>2021-02-20T21:43:52Z</dc:date>
    </item>
    <item>
      <title>Re: &lt;change&gt; event firing before the user ever makes a change to the form input?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/lt-change-gt-event-firing-before-the-user-ever-makes-a-change-to/m-p/540862#M153075</link>
      <description>&lt;P&gt;Thanks for the response&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/49493"&gt;@tscroggins&lt;/a&gt;&amp;nbsp;!&lt;BR /&gt;&lt;BR /&gt;I guess I am/was confused that `&amp;lt;change&amp;gt;` event fires even on init. I thought it would depending on user input first.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 16:05:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/lt-change-gt-event-firing-before-the-user-ever-makes-a-change-to/m-p/540862#M153075</guid>
      <dc:creator>tonymaibox</dc:creator>
      <dc:date>2021-02-22T16:05:34Z</dc:date>
    </item>
  </channel>
</rss>

