<?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: Customizable Visualizations in Dashboard in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Customizable-Visualizations-in-Dashboard/m-p/294797#M18708</link>
    <description>&lt;P&gt;@AshimaE, you would need to add little bit of more details with your use case. What are the values for two dropdown? What kind of query is being formed? Does one dropdown provide query and other visualization? Or is it a combination of both?&lt;/P&gt;

&lt;P&gt;In either case you need to code dropdown's change Event Handler to pass on query string and token to show/hide a panel. You might have to unset other tokens to hide unwanted panels. Also you can use these tokens within queries to ensure that hidden panels do not run query in background. However, details will depend on your use case and you need to provide more details as requested for the same.&lt;/P&gt;

&lt;P&gt;Following run anywhere example gives a demo of coding change event handler for Drop downs and &lt;STRONG&gt;set&lt;/STRONG&gt;/&lt;STRONG&gt;unset&lt;/STRONG&gt; tokens. &lt;CODE&gt;$value$&lt;/CODE&gt; and &lt;CODE&gt;$label$&lt;/CODE&gt; are default Drop down tokens. It further exemplifies the use of &lt;STRONG&gt;depends&lt;/STRONG&gt; to hide a panel when the token/s is not set (PS: reverse behavior can be achieved via &lt;STRONG&gt;rejects&lt;/STRONG&gt;)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="dropdown" token="field1" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;field1&amp;lt;/label&amp;gt;
      &amp;lt;choice value="value1"&amp;gt;Value 1&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="value2"&amp;gt;Value 2&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="value3"&amp;gt;Value 3&amp;lt;/choice&amp;gt;
      &amp;lt;change&amp;gt;
        &amp;lt;condition value="value1"&amp;gt;
          &amp;lt;set token="query1"&amp;gt;| makeresults | eval $label$="$value$"&amp;lt;/set&amp;gt;
          &amp;lt;set token="showHTML1"&amp;gt;true&amp;lt;/set&amp;gt;
          &amp;lt;unset token="showHTML2"&amp;gt;&amp;lt;/unset&amp;gt;
        &amp;lt;/condition&amp;gt;
        &amp;lt;condition value="value2"&amp;gt;
          &amp;lt;set token="query1"&amp;gt;| makeresults | eval $label$="$value$"&amp;lt;/set&amp;gt;          
          &amp;lt;set token="showHTML1"&amp;gt;true&amp;lt;/set&amp;gt;
          &amp;lt;unset token="showHTML2"&amp;gt;&amp;lt;/unset&amp;gt;
        &amp;lt;/condition&amp;gt;
        &amp;lt;condition value="value3"&amp;gt;
          &amp;lt;set token="query1"&amp;gt;| makeresults | eval $label$="$value$"&amp;lt;/set&amp;gt;          
          &amp;lt;set token="showHTML1"&amp;gt;true&amp;lt;/set&amp;gt;
          &amp;lt;unset token="showHTML2"&amp;gt;&amp;lt;/unset&amp;gt;
        &amp;lt;/condition&amp;gt;
      &amp;lt;/change&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="dropdown" token="field2" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;field2&amp;lt;/label&amp;gt;
      &amp;lt;choice value="value1"&amp;gt;Value 1&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="value2"&amp;gt;Value 2&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="value3"&amp;gt;Value 3&amp;lt;/choice&amp;gt;
      &amp;lt;change&amp;gt;
        &amp;lt;condition value="value1"&amp;gt;
          &amp;lt;set token="query2"&amp;gt;| makeresults | eval $label$="$value$"&amp;lt;/set&amp;gt;
          &amp;lt;set token="showHTML2"&amp;gt;true&amp;lt;/set&amp;gt;
          &amp;lt;unset token="showHTML1"&amp;gt;&amp;lt;/unset&amp;gt;
        &amp;lt;/condition&amp;gt;
        &amp;lt;condition value="value2"&amp;gt;
          &amp;lt;set token="query2"&amp;gt;| makeresults | eval $label$="$value$"&amp;lt;/set&amp;gt;
          &amp;lt;set token="showHTML2"&amp;gt;true&amp;lt;/set&amp;gt;
          &amp;lt;unset token="showHTML1"&amp;gt;&amp;lt;/unset&amp;gt;
        &amp;lt;/condition&amp;gt;    
        &amp;lt;condition value="value3"&amp;gt;
          &amp;lt;set token="query2"&amp;gt;| makeresults | eval $label$="$value$"&amp;lt;/set&amp;gt;
          &amp;lt;set token="showHTML2"&amp;gt;true&amp;lt;/set&amp;gt;
          &amp;lt;unset token="showHTML1"&amp;gt;&amp;lt;/unset&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;html depends="$showHTML1$"&amp;gt;
      &amp;lt;style&amp;gt;
        .mytitle{
          font-size:150%;
          color:red;
        }
        .myinfo{
          font-size:120%;
          color:blue;
        }
      &amp;lt;/style&amp;gt;
      &amp;lt;div class="mytitle"&amp;gt;
        HTML Panel 1
      &amp;lt;/div&amp;gt;
      &amp;lt;div&amp;gt;
        &amp;lt;p class="myinfo"&amp;gt;$query1$&amp;lt;/p&amp;gt;
      &amp;lt;/div&amp;gt;
    &amp;lt;/html&amp;gt;
    &amp;lt;html depends="$showHTML2$"&amp;gt;
      &amp;lt;div class="mytitle"&amp;gt;
        HTML Panel 2
      &amp;lt;/div&amp;gt;
      &amp;lt;div&amp;gt;
        &amp;lt;p class="myinfo"&amp;gt;$query2$&amp;lt;/p&amp;gt;
      &amp;lt;/div&amp;gt;
    &amp;lt;/html&amp;gt;
  &amp;lt;/panel&amp;gt;
&amp;lt;/row&amp;gt;  
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can get the Splunk 6.x Dashboard Examples App from Splunkbase to get examples of these and many more. For us to assist please provide more details of your use case.&lt;/P&gt;</description>
    <pubDate>Tue, 04 Jul 2017 13:24:52 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2017-07-04T13:24:52Z</dc:date>
    <item>
      <title>Customizable Visualizations in Dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Customizable-Visualizations-in-Dashboard/m-p/294795#M18706</link>
      <description>&lt;P&gt;I wish to design a Search Generator Dashboard which after taking two fields as drop down inputs will give a text box to type a query related to the given inputs and present the results as a panel. How can I do so?(Create a visualization panel as an output for given inputs. Also is it possible to create customizable output i.e.user has a choice to change the type of visuaization for the result).&lt;/P&gt;

&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2017 10:01:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Customizable-Visualizations-in-Dashboard/m-p/294795#M18706</guid>
      <dc:creator>AshimaE</dc:creator>
      <dc:date>2017-07-04T10:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: Customizable Visualizations in Dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Customizable-Visualizations-in-Dashboard/m-p/294796#M18707</link>
      <description>&lt;P&gt;hello @AshimaE,&lt;BR /&gt;
hope I understand your question. &lt;BR /&gt;
look at the screenshot of the dashboard i created:&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3162iBE4DF8814539D1B4/image-size/large?v=v2&amp;amp;px=999" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;here you have a dropdown to choose from 2 fields, source and sourcetype, and in the text input, you can insert any string you would like. the challenge i found was that you will have to edit  visualization based on the search (not sure how and if it can be automated). here table is good but if for example, you will choose the timechart command, table will probably will not be the best viz for you&lt;BR /&gt;
just in case you are interested, here is the code for this sample:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;Field and Search Inputs&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="time" token="field1"&amp;gt;
      &amp;lt;label&amp;gt;&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;
        &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
      &amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="dropdown" token="FIELD"&amp;gt;
      &amp;lt;label&amp;gt;Choose Field&amp;lt;/label&amp;gt;
      &amp;lt;choice value="sourcetype"&amp;gt;Sourcetype&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="source"&amp;gt;Source&amp;lt;/choice&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="COMMAND"&amp;gt;
      &amp;lt;label&amp;gt;Enter Your Command&amp;lt;/label&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;index = _internal $FIELD$=* $COMMAND$&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;$field1.earliest$&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;$field1.latest$&amp;lt;/latest&amp;gt;
          &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&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;

&lt;P&gt;hope it helps&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2017 12:33:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Customizable-Visualizations-in-Dashboard/m-p/294796#M18707</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2017-07-04T12:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: Customizable Visualizations in Dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Customizable-Visualizations-in-Dashboard/m-p/294797#M18708</link>
      <description>&lt;P&gt;@AshimaE, you would need to add little bit of more details with your use case. What are the values for two dropdown? What kind of query is being formed? Does one dropdown provide query and other visualization? Or is it a combination of both?&lt;/P&gt;

&lt;P&gt;In either case you need to code dropdown's change Event Handler to pass on query string and token to show/hide a panel. You might have to unset other tokens to hide unwanted panels. Also you can use these tokens within queries to ensure that hidden panels do not run query in background. However, details will depend on your use case and you need to provide more details as requested for the same.&lt;/P&gt;

&lt;P&gt;Following run anywhere example gives a demo of coding change event handler for Drop downs and &lt;STRONG&gt;set&lt;/STRONG&gt;/&lt;STRONG&gt;unset&lt;/STRONG&gt; tokens. &lt;CODE&gt;$value$&lt;/CODE&gt; and &lt;CODE&gt;$label$&lt;/CODE&gt; are default Drop down tokens. It further exemplifies the use of &lt;STRONG&gt;depends&lt;/STRONG&gt; to hide a panel when the token/s is not set (PS: reverse behavior can be achieved via &lt;STRONG&gt;rejects&lt;/STRONG&gt;)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="dropdown" token="field1" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;field1&amp;lt;/label&amp;gt;
      &amp;lt;choice value="value1"&amp;gt;Value 1&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="value2"&amp;gt;Value 2&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="value3"&amp;gt;Value 3&amp;lt;/choice&amp;gt;
      &amp;lt;change&amp;gt;
        &amp;lt;condition value="value1"&amp;gt;
          &amp;lt;set token="query1"&amp;gt;| makeresults | eval $label$="$value$"&amp;lt;/set&amp;gt;
          &amp;lt;set token="showHTML1"&amp;gt;true&amp;lt;/set&amp;gt;
          &amp;lt;unset token="showHTML2"&amp;gt;&amp;lt;/unset&amp;gt;
        &amp;lt;/condition&amp;gt;
        &amp;lt;condition value="value2"&amp;gt;
          &amp;lt;set token="query1"&amp;gt;| makeresults | eval $label$="$value$"&amp;lt;/set&amp;gt;          
          &amp;lt;set token="showHTML1"&amp;gt;true&amp;lt;/set&amp;gt;
          &amp;lt;unset token="showHTML2"&amp;gt;&amp;lt;/unset&amp;gt;
        &amp;lt;/condition&amp;gt;
        &amp;lt;condition value="value3"&amp;gt;
          &amp;lt;set token="query1"&amp;gt;| makeresults | eval $label$="$value$"&amp;lt;/set&amp;gt;          
          &amp;lt;set token="showHTML1"&amp;gt;true&amp;lt;/set&amp;gt;
          &amp;lt;unset token="showHTML2"&amp;gt;&amp;lt;/unset&amp;gt;
        &amp;lt;/condition&amp;gt;
      &amp;lt;/change&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="dropdown" token="field2" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;field2&amp;lt;/label&amp;gt;
      &amp;lt;choice value="value1"&amp;gt;Value 1&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="value2"&amp;gt;Value 2&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="value3"&amp;gt;Value 3&amp;lt;/choice&amp;gt;
      &amp;lt;change&amp;gt;
        &amp;lt;condition value="value1"&amp;gt;
          &amp;lt;set token="query2"&amp;gt;| makeresults | eval $label$="$value$"&amp;lt;/set&amp;gt;
          &amp;lt;set token="showHTML2"&amp;gt;true&amp;lt;/set&amp;gt;
          &amp;lt;unset token="showHTML1"&amp;gt;&amp;lt;/unset&amp;gt;
        &amp;lt;/condition&amp;gt;
        &amp;lt;condition value="value2"&amp;gt;
          &amp;lt;set token="query2"&amp;gt;| makeresults | eval $label$="$value$"&amp;lt;/set&amp;gt;
          &amp;lt;set token="showHTML2"&amp;gt;true&amp;lt;/set&amp;gt;
          &amp;lt;unset token="showHTML1"&amp;gt;&amp;lt;/unset&amp;gt;
        &amp;lt;/condition&amp;gt;    
        &amp;lt;condition value="value3"&amp;gt;
          &amp;lt;set token="query2"&amp;gt;| makeresults | eval $label$="$value$"&amp;lt;/set&amp;gt;
          &amp;lt;set token="showHTML2"&amp;gt;true&amp;lt;/set&amp;gt;
          &amp;lt;unset token="showHTML1"&amp;gt;&amp;lt;/unset&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;html depends="$showHTML1$"&amp;gt;
      &amp;lt;style&amp;gt;
        .mytitle{
          font-size:150%;
          color:red;
        }
        .myinfo{
          font-size:120%;
          color:blue;
        }
      &amp;lt;/style&amp;gt;
      &amp;lt;div class="mytitle"&amp;gt;
        HTML Panel 1
      &amp;lt;/div&amp;gt;
      &amp;lt;div&amp;gt;
        &amp;lt;p class="myinfo"&amp;gt;$query1$&amp;lt;/p&amp;gt;
      &amp;lt;/div&amp;gt;
    &amp;lt;/html&amp;gt;
    &amp;lt;html depends="$showHTML2$"&amp;gt;
      &amp;lt;div class="mytitle"&amp;gt;
        HTML Panel 2
      &amp;lt;/div&amp;gt;
      &amp;lt;div&amp;gt;
        &amp;lt;p class="myinfo"&amp;gt;$query2$&amp;lt;/p&amp;gt;
      &amp;lt;/div&amp;gt;
    &amp;lt;/html&amp;gt;
  &amp;lt;/panel&amp;gt;
&amp;lt;/row&amp;gt;  
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can get the Splunk 6.x Dashboard Examples App from Splunkbase to get examples of these and many more. For us to assist please provide more details of your use case.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2017 13:24:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Customizable-Visualizations-in-Dashboard/m-p/294797#M18708</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-07-04T13:24:52Z</dc:date>
    </item>
    <item>
      <title>Re: Customizable Visualizations in Dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Customizable-Visualizations-in-Dashboard/m-p/294798#M18709</link>
      <description>&lt;P&gt;@AshimaE, please confirm whether this helps with your issue or not. Provide us with more details if this is not useful.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2017 17:52:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Customizable-Visualizations-in-Dashboard/m-p/294798#M18709</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-07-07T17:52:46Z</dc:date>
    </item>
  </channel>
</rss>

