<?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: change event handler not working for token from within the same input in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/change-event-handler-not-working-for-token-from-within-the-same/m-p/550486#M38025</link>
    <description>&lt;P&gt;Thanks &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/102823"&gt;@ragedsparrow&lt;/a&gt;. it worked like a charm &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 05 May 2021 05:03:31 GMT</pubDate>
    <dc:creator>meleperuma</dc:creator>
    <dc:date>2021-05-05T05:03:31Z</dc:date>
    <item>
      <title>change event handler not working for token from within the same input</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/change-event-handler-not-working-for-token-from-within-the-same/m-p/550477#M38020</link>
      <description>&lt;P&gt;I'm having certain panel in my dashboard using | pivot command and others using | datamodel command (coz there are certain things you cant do with pivot).&lt;/P&gt;&lt;P&gt;I want to allow the user to select the granularity of the time charts in the dashboard when they select a longer time range.&lt;/P&gt;&lt;P&gt;So, in the change event handler, I'm trying to convert the span value compatible with the period argument in pivot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;input type="dropdown" token="span" searchWhenChanged="true"&amp;gt;
&amp;lt;label&amp;gt;Granularity&amp;lt;/label&amp;gt;
&amp;lt;choice value=""&amp;gt;Default&amp;lt;/choice&amp;gt;
&amp;lt;choice value="span=1m"&amp;gt;1 min&amp;lt;/choice&amp;gt;
&amp;lt;choice value="span=15m"&amp;gt;15 min&amp;lt;/choice&amp;gt;
&amp;lt;choice value="span=30m"&amp;gt;30 min&amp;lt;/choice&amp;gt;
&amp;lt;choice value="span=1h"&amp;gt;1 hour&amp;lt;/choice&amp;gt;
&amp;lt;choice value="span=1d"&amp;gt;1 day&amp;lt;/choice&amp;gt;
&amp;lt;default&amp;gt;&amp;lt;/default&amp;gt;
&amp;lt;change&amp;gt;
&amp;lt;eval token="PivotPeriodAutoSolo"&amp;gt;case("$span$"="span=1m", "1m", "$span$"="span=15m", "15m", "$span$"="span=30m", 30m, "$span$"="span=1h", 1h, "$span$"="span=1d", 1d, 1=1, "auto")&amp;lt;/eval&amp;gt;
&amp;lt;/change&amp;gt;
&amp;lt;/input&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;But for some reason this change does not get applied.&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 03:22:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/change-event-handler-not-working-for-token-from-within-the-same/m-p/550477#M38020</guid>
      <dc:creator>meleperuma</dc:creator>
      <dc:date>2021-05-05T03:22:40Z</dc:date>
    </item>
    <item>
      <title>change event handler not working for token from within the same input</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/change-event-handler-not-working-for-token-from-within-the-same/m-p/550479#M38021</link>
      <description>&lt;P&gt;I'm just curious on why you need the case statement?&amp;nbsp; You are basically doing the case in the drop down, so I would set the default option to "auto" (which is your default value in your case), and use the dropdown token.&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 04:11:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/change-event-handler-not-working-for-token-from-within-the-same/m-p/550479#M38021</guid>
      <dc:creator>ragedsparrow</dc:creator>
      <dc:date>2021-05-05T04:11:58Z</dc:date>
    </item>
    <item>
      <title>Re: change event handler not working for token from within the same input</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/change-event-handler-not-working-for-token-from-within-the-same/m-p/550483#M38022</link>
      <description>&lt;P&gt;Below is one of the panel searches&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| pivot `uA_DM_Process_ProcessDetail` Process_ProcessDetail 
  sum(ProcCPUPercent) as ProcCPUPercent 
  splitrow AppName as "App name" 
  splitrow time as _time period $PivotPeriodAutoSolo$ 
  splitrow host as host 
  filter AppName isNot "Microsoft Windows OS" 
  $SearchFilter$  
| timechart $span$ perc90(ProcCPUPercent) as "avg(ProcCPUPercent)" by "App name" 
| join type=outer _time 
    [| pivot `uA_DM_System_SystemPerformanceSummary` System_SystemPerformanceSummary
        max(CPURelativeFrequencyPercent) as "Max.CPURelativeFrequencyPercent"
        splitrow _time
        period $PivotPeriodAutoSolo$
        $SearchFilter$ ]&lt;/LI-CODE&gt;&lt;P&gt;As you can see here, since I have use different formats for span in pivot and timechart commands, I have to do the conversion. And the reason I'm keeping the default value "" (blank) is not to cause any syntax errors in case I use "span" as a timachart option.&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 04:36:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/change-event-handler-not-working-for-token-from-within-the-same/m-p/550483#M38022</guid>
      <dc:creator>meleperuma</dc:creator>
      <dc:date>2021-05-05T04:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: change event handler not working for token from within the same input</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/change-event-handler-not-working-for-token-from-within-the-same/m-p/550485#M38024</link>
      <description>&lt;P&gt;That makes sense.&amp;nbsp; When you have a change tag, you have to use the condition tag as well to set the token. This could also take the place of your case statement.&amp;nbsp; Here is what I used as a rudimentary test.&amp;nbsp; Hopefully it gets you down the road for your solution:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    &amp;lt;input type="dropdown" token="span" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Granularity&amp;lt;/label&amp;gt;
      &amp;lt;choice value=""&amp;gt;Default&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="span=1m"&amp;gt;1 min&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="span=15m"&amp;gt;15 min&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="span=30m"&amp;gt;30 min&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="span=1h"&amp;gt;1 hour&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="span=1d"&amp;gt;1 day&amp;lt;/choice&amp;gt;
      &amp;lt;change&amp;gt;
        &amp;lt;condition value="span=1m"&amp;gt;
          &amp;lt;set token="PivotPeriodAutoSolo"&amp;gt;1m&amp;lt;/set&amp;gt;
        &amp;lt;/condition&amp;gt;
        &amp;lt;condition value="span=15m"&amp;gt;
          &amp;lt;set token="PivotPeriodAutoSolo"&amp;gt;15m&amp;lt;/set&amp;gt;
        &amp;lt;/condition&amp;gt;
        &amp;lt;condition value="span=30m"&amp;gt;
          &amp;lt;set token="PivotPeriodAutoSolo"&amp;gt;30m&amp;lt;/set&amp;gt;
        &amp;lt;/condition&amp;gt;
        &amp;lt;condition value="span=1h"&amp;gt;
          &amp;lt;set token="PivotPeriodAutoSolo"&amp;gt;1h&amp;lt;/set&amp;gt;
        &amp;lt;/condition&amp;gt;
        &amp;lt;condition value="span=1d"&amp;gt;
          &amp;lt;set token="PivotPeriodAutoSolo"&amp;gt;1d&amp;lt;/set&amp;gt;
        &amp;lt;/condition&amp;gt;
        &amp;lt;condition value=""&amp;gt;
          &amp;lt;set token="PivotPeriodAutoSolo"&amp;gt;auto&amp;lt;/set&amp;gt;
        &amp;lt;/condition&amp;gt;
      &amp;lt;/change&amp;gt;
    &amp;lt;/input&amp;gt;&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 05 May 2021 04:57:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/change-event-handler-not-working-for-token-from-within-the-same/m-p/550485#M38024</guid>
      <dc:creator>ragedsparrow</dc:creator>
      <dc:date>2021-05-05T04:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: change event handler not working for token from within the same input</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/change-event-handler-not-working-for-token-from-within-the-same/m-p/550486#M38025</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/102823"&gt;@ragedsparrow&lt;/a&gt;. it worked like a charm &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 05:03:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/change-event-handler-not-working-for-token-from-within-the-same/m-p/550486#M38025</guid>
      <dc:creator>meleperuma</dc:creator>
      <dc:date>2021-05-05T05:03:31Z</dc:date>
    </item>
  </channel>
</rss>

