<?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: Simple xml submit button in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Simple-xml-submit-button/m-p/313690#M40311</link>
    <description>&lt;P&gt;would you be able to use the timeframe token itself in a base search, and then set your tokens once that search is finalized?  Not sure how much more trouble that would be, but might be a workaround for now?  This way you're actually using the token that should respect the submit button.&lt;/P&gt;

&lt;P&gt;Maybe something like this, where the input section is the same as yours minus the change tag.  Note, I just typed this out with absolutely no testing so probably won't work as is.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
    &amp;lt;fieldset&amp;gt;
        &amp;lt;input&amp;gt;
        &amp;lt;/input&amp;gt;
    &amp;lt;/fieldset&amp;gt;
    &amp;lt;search id="set_token"&amp;gt;
        &amp;lt;query&amp;gt; | stats count | eval tf=$timeframe$ | rex field=tf "^(?&amp;lt;begin&amp;gt;[^-]+)-(?&amp;lt;end&amp;gt;.+)" | eval begin=strptime(begin,"%m/%d/%y %H:%M:%S"),end=strptime(end,"%m/%d/%y %H:%M:%S") | fields begin, end&amp;lt;/query&amp;gt;
        &amp;lt;finalized&amp;gt;
            &amp;lt;set token="tok_earliest"&amp;gt;$result.begin$&amp;lt;/set&amp;gt;
            &amp;lt;set token="tok_latest"&amp;gt;$result.end$&amp;lt;/set&amp;gt;
        &amp;lt;/finalized&amp;gt;
    &amp;lt;/search&amp;gt;
    &amp;lt;row&amp;gt;
        &amp;lt;panel&amp;gt;&amp;lt;/panel&amp;gt;
    &amp;lt;/row&amp;gt;
    .
    .
    .
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;HR /&gt;

&lt;P&gt;updated as per feedback for typos.&lt;/P&gt;</description>
    <pubDate>Tue, 28 Nov 2017 17:38:48 GMT</pubDate>
    <dc:creator>maciep</dc:creator>
    <dc:date>2017-11-28T17:38:48Z</dc:date>
    <item>
      <title>Simple xml submit button</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Simple-xml-submit-button/m-p/313688#M40309</link>
      <description>&lt;P&gt;The submit button on simple xml seems to have no effect.  I have a dropdown that runs a query and sets tokens for earliest/latest based on a selection.  Every change in the dropdown reruns the search in subsequent dashboard panel.&lt;/P&gt;

&lt;P&gt;Here is a link to the simple xml code (someday I will have enough Karma points to be productive on here)&lt;/P&gt;

&lt;P&gt;&lt;A href="https://imgur.com/IXw5jzN"&gt;https://imgur.com/IXw5jzN&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2017 16:14:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Simple-xml-submit-button/m-p/313688#M40309</guid>
      <dc:creator>mschellhouse</dc:creator>
      <dc:date>2017-11-28T16:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: Simple xml submit button</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Simple-xml-submit-button/m-p/313689#M40310</link>
      <description>&lt;P&gt;What you are seeing is a side-effect of what I posted here: &lt;A href="https://answers.splunk.com/answers/548647/enhancement-request-make-change-conditional-tokens.html"&gt;https://answers.splunk.com/answers/548647/enhancement-request-make-change-conditional-tokens.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Basically, any token changes inside of the &lt;CODE&gt;&amp;lt;change&amp;gt;&lt;/CODE&gt; block are immediate regardless of how you set &lt;CODE&gt;searchWhenChanged&lt;/CODE&gt;. There is no built-in workaround in SimpleXML that doesn't require you changing how you do inputs. The only other option is implement the logic in JavaScript, which is probably overkill.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2017 16:29:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Simple-xml-submit-button/m-p/313689#M40310</guid>
      <dc:creator>rjthibod</dc:creator>
      <dc:date>2017-11-28T16:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: Simple xml submit button</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Simple-xml-submit-button/m-p/313690#M40311</link>
      <description>&lt;P&gt;would you be able to use the timeframe token itself in a base search, and then set your tokens once that search is finalized?  Not sure how much more trouble that would be, but might be a workaround for now?  This way you're actually using the token that should respect the submit button.&lt;/P&gt;

&lt;P&gt;Maybe something like this, where the input section is the same as yours minus the change tag.  Note, I just typed this out with absolutely no testing so probably won't work as is.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
    &amp;lt;fieldset&amp;gt;
        &amp;lt;input&amp;gt;
        &amp;lt;/input&amp;gt;
    &amp;lt;/fieldset&amp;gt;
    &amp;lt;search id="set_token"&amp;gt;
        &amp;lt;query&amp;gt; | stats count | eval tf=$timeframe$ | rex field=tf "^(?&amp;lt;begin&amp;gt;[^-]+)-(?&amp;lt;end&amp;gt;.+)" | eval begin=strptime(begin,"%m/%d/%y %H:%M:%S"),end=strptime(end,"%m/%d/%y %H:%M:%S") | fields begin, end&amp;lt;/query&amp;gt;
        &amp;lt;finalized&amp;gt;
            &amp;lt;set token="tok_earliest"&amp;gt;$result.begin$&amp;lt;/set&amp;gt;
            &amp;lt;set token="tok_latest"&amp;gt;$result.end$&amp;lt;/set&amp;gt;
        &amp;lt;/finalized&amp;gt;
    &amp;lt;/search&amp;gt;
    &amp;lt;row&amp;gt;
        &amp;lt;panel&amp;gt;&amp;lt;/panel&amp;gt;
    &amp;lt;/row&amp;gt;
    .
    .
    .
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;HR /&gt;

&lt;P&gt;updated as per feedback for typos.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2017 17:38:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Simple-xml-submit-button/m-p/313690#M40311</guid>
      <dc:creator>maciep</dc:creator>
      <dc:date>2017-11-28T17:38:48Z</dc:date>
    </item>
    <item>
      <title>Re: Simple xml submit button</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Simple-xml-submit-button/m-p/313691#M40312</link>
      <description>&lt;P&gt;I am trying to implement this approach and it doesn't seem to set the tokens.  Except for one small typo, your logic is solid.  Dumping the query into a panel and running does work.  Seems like there may be a limitation or some special condition in doing this in a base search?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2017 20:30:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Simple-xml-submit-button/m-p/313691#M40312</guid>
      <dc:creator>mschellhouse</dc:creator>
      <dc:date>2017-11-28T20:30:44Z</dc:date>
    </item>
    <item>
      <title>Re: Simple xml submit button</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Simple-xml-submit-button/m-p/313692#M40313</link>
      <description>&lt;P&gt;Changing $row.xxx$ to $result.xxx$ appears to have worked. &lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2017 21:00:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Simple-xml-submit-button/m-p/313692#M40313</guid>
      <dc:creator>mschellhouse</dc:creator>
      <dc:date>2017-11-28T21:00:53Z</dc:date>
    </item>
  </channel>
</rss>

