<?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: Bad Dashboard Interaction: Form Input Derived Token and URL Input Arguments in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Bad-Dashboard-Interaction-Form-Input-Derived-Token-and-URL-Input/m-p/491397#M32190</link>
    <description>&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.1/Viz/tokens#Set_tokens_on_page_load" target="_blank"&gt;Set_tokens_on_page_load&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;set &lt;CODE&gt;&amp;lt;init&amp;gt;&lt;/CODE&gt;,  how about this?&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 03:49:02 GMT</pubDate>
    <dc:creator>to4kawa</dc:creator>
    <dc:date>2020-09-30T03:49:02Z</dc:date>
    <item>
      <title>Bad Dashboard Interaction: Form Input Derived Token and URL Input Arguments</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Bad-Dashboard-Interaction-Form-Input-Derived-Token-and-URL-Input/m-p/491396#M32189</link>
      <description>&lt;P&gt;I am having trouble supporting both URL link parameters for a form input/token and "derived" value tokens which are computed from the value of a form token.  As an example, imagine that I have two tokens, &lt;STRONG&gt;tok&lt;/STRONG&gt; and &lt;STRONG&gt;derived&lt;/STRONG&gt;.  The token &lt;STRONG&gt;derived&lt;/STRONG&gt; is set when token &lt;STRONG&gt;tok&lt;/STRONG&gt; is changed, as follows...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;      &amp;lt;input token=“tok”&amp;gt;
        &amp;lt;label&amp;gt;Summary Interval&amp;lt;/label&amp;gt;
        &amp;lt;choice value="10minute"&amp;gt;10 minutes&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="1hour"&amp;gt;1 hour&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="1day"&amp;gt;1 day&amp;lt;/choice&amp;gt;
        &amp;lt;default&amp;gt;1hour&amp;lt;/default&amp;gt;
        &amp;lt;change&amp;gt;
          &amp;lt;condition value="10minute"&amp;gt;
            &amp;lt;eval token="derived"&amp;gt;minspan=10m&amp;lt;/eval&amp;gt;
          &amp;lt;/condition&amp;gt;
          &amp;lt;condition&amp;gt;
            &amp;lt;set token="derived"&amp;gt;&amp;lt;/set&amp;gt;
          &amp;lt;/condition&amp;gt;
        &amp;lt;/change&amp;gt;
      &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The problem comes when a user links to this dashboard setting &lt;STRONG&gt;tok&lt;/STRONG&gt; to "10minute" in the URL (with something like "tok=10minute" in the args).  In this case, it seems that the token &lt;STRONG&gt;derived&lt;/STRONG&gt; will not be set at all, causing any dependent dashboard panels to wait on token input.&lt;/P&gt;

&lt;P&gt;I can work around by computing &lt;STRONG&gt;derived&lt;/STRONG&gt; in a search instead, but it sure is convenient to simply set such a related (derived) token right here in the token it depends on.  Does this usage of a &lt;EM&gt;change&lt;/EM&gt; clause in the input pretty much ensure that bookmarks and other URL links containing token &lt;STRONG&gt;tok&lt;/STRONG&gt; will be a problem?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2020 20:44:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Bad-Dashboard-Interaction-Form-Input-Derived-Token-and-URL-Input/m-p/491396#M32189</guid>
      <dc:creator>kulick</dc:creator>
      <dc:date>2020-01-24T20:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: Bad Dashboard Interaction: Form Input Derived Token and URL Input Arguments</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Bad-Dashboard-Interaction-Form-Input-Derived-Token-and-URL-Input/m-p/491397#M32190</link>
      <description>&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.1/Viz/tokens#Set_tokens_on_page_load" target="_blank"&gt;Set_tokens_on_page_load&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;set &lt;CODE&gt;&amp;lt;init&amp;gt;&lt;/CODE&gt;,  how about this?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:49:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Bad-Dashboard-Interaction-Form-Input-Derived-Token-and-URL-Input/m-p/491397#M32190</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-09-30T03:49:02Z</dc:date>
    </item>
    <item>
      <title>Re: Bad Dashboard Interaction: Form Input Derived Token and URL Input Arguments</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Bad-Dashboard-Interaction-Form-Input-Derived-Token-and-URL-Input/m-p/491398#M32191</link>
      <description>&lt;P&gt;@kulick do you have &lt;CODE&gt;searchWhenChanged&lt;/CODE&gt; for input set to &lt;CODE&gt;true&lt;/CODE&gt; and &lt;CODE&gt;submitButton&lt;/CODE&gt; turned false?&lt;/P&gt;

&lt;P&gt;Also instead of &lt;CODE&gt;&amp;lt;eval&amp;gt;&lt;/CODE&gt; use &lt;CODE&gt;&amp;lt;set&amp;gt;&lt;/CODE&gt; to set the derived token in your dashboard&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;set token="derived"&amp;gt;minspan=10m&amp;lt;/set&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;PS: I tried the following code and it worked fine.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Source Dashboard&lt;/STRONG&gt;&lt;BR /&gt;
Used to link to Destination dashboard with input token value &lt;CODE&gt;form.tokSummary=10minutes&lt;/CODE&gt; set&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard&amp;gt;
  &amp;lt;label&amp;gt;Source dashboard with time span&amp;lt;/label&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html&amp;gt;
        &amp;lt;a target="_blank" href="https://&amp;lt;yourSplunkServer&amp;gt;:&amp;lt;yourSplunkWebPort&amp;gt;/en-US/app/search/&amp;lt;yourDestinationDashboardName&amp;gt;?form.tokSummary=10minute"&amp;gt;Click to Pass Span to destination dashboard&amp;lt;/a&amp;gt;
      &amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Destination Dashboard&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;Destination Dashboard with span input&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="dropdown" searchWhenChanged="true" token="tokSummary"&amp;gt;
      &amp;lt;label&amp;gt;Summary Interval&amp;lt;/label&amp;gt;
      &amp;lt;choice value="10minute"&amp;gt;10 minutes&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="1hour"&amp;gt;1 hour&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="1day"&amp;gt;1 day&amp;lt;/choice&amp;gt;
      &amp;lt;default&amp;gt;1hour&amp;lt;/default&amp;gt;
      &amp;lt;change&amp;gt;
        &amp;lt;condition value="10minute"&amp;gt;
          &amp;lt;set token="derived"&amp;gt;minspan=10m&amp;lt;/set&amp;gt;
        &amp;lt;/condition&amp;gt;
        &amp;lt;condition&amp;gt;
          &amp;lt;set token="derived"&amp;gt; &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;search&amp;gt;
          &amp;lt;query&amp;gt;| makeresults
          | fields - _time
          | eval inputToken="$tokSummary$",derived="$derived$"&amp;lt;/query&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>Sun, 26 Jan 2020 17:15:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Bad-Dashboard-Interaction-Form-Input-Derived-Token-and-URL-Input/m-p/491398#M32191</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-01-26T17:15:15Z</dc:date>
    </item>
    <item>
      <title>Re: Bad Dashboard Interaction: Form Input Derived Token and URL Input Arguments</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Bad-Dashboard-Interaction-Form-Input-Derived-Token-and-URL-Input/m-p/531730#M36145</link>
      <description>&lt;P&gt;Sorry for the slow reply and thanks for the code review.&amp;nbsp; Definitely misused eval there in my example.&amp;nbsp; I will use searchWhenChanged="true" in the future.&amp;nbsp; Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 16:13:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Bad-Dashboard-Interaction-Form-Input-Derived-Token-and-URL-Input/m-p/531730#M36145</guid>
      <dc:creator>kulick</dc:creator>
      <dc:date>2020-12-02T16:13:10Z</dc:date>
    </item>
  </channel>
</rss>

