<?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: How to create a single dashboard that will change the search for each panel based on a dropdown input option? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-single-dashboard-that-will-change-the-search-for/m-p/371769#M109393</link>
    <description>&lt;P&gt;Ill post some sample code from a dashboard does this.&lt;/P&gt;

&lt;P&gt;Here are the "filters" at the top. You can either add static entries to these, or use searched to populate them. &lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/2667i3E7CB0C4CEFEC0EE/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Now some code for what they look like&lt;/P&gt;

&lt;P&gt;This is the code for the "Host Groups" token. It auto-populates based on a search. This then fills the $hostgroup$ token in any of the search panels in the dashboard.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;input type="multiselect" searchWhenChanged="false" token="hostgroup"&amp;gt;
      &amp;lt;label&amp;gt;Host Groups&amp;lt;/label&amp;gt;
      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;index=application  sourcetype="apollo:prod:pegarules" |eval  host=upper(host) |top host limit=100 showcount=false showperc=false |sort + host&amp;lt;/query&amp;gt;
        &amp;lt;earliest&amp;gt;-15m&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
      &amp;lt;/search&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;host&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;host&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;choice value="ttapp* OR host=amusttnup80*"&amp;gt;All&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="TTAPPPEGAAG*"&amp;gt;Agent Servers&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="TTAPPPEGAWEB*"&amp;gt;Web Servers&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="TTAPPPEGACC*"&amp;gt;Call Center Servers&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="amusttnup80003 OR host=amusttnup80004"&amp;gt;NextGen Call Center&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="TTAPPPEGAAPP* OR host=TTAPPPEGAWEB*"&amp;gt;Portal (Web and App)&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="amusttnup80005 OR host=amusttnup80006 OR host=amusttnup8007 OR host=amusttnup80007 OR host=amusttnup80008"&amp;gt;NextGen Portal&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="TTAPPPEGAAPP*"&amp;gt;APP Servers&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="TTAPPPEGAADM*"&amp;gt;Admin Servers&amp;lt;/choice&amp;gt;
      &amp;lt;prefix&amp;gt;(&amp;lt;/prefix&amp;gt;
      &amp;lt;suffix&amp;gt;)&amp;lt;/suffix&amp;gt;
      &amp;lt;delimiter&amp;gt; OR &amp;lt;/delimiter&amp;gt;
      &amp;lt;valuePrefix&amp;gt;host=&amp;lt;/valuePrefix&amp;gt;
      &amp;lt;default&amp;gt;TTAPPPEGACC*&amp;lt;/default&amp;gt;
      &amp;lt;initialValue&amp;gt;TTAPPPEGACC*&amp;lt;/initialValue&amp;gt;
    &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sample search.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;panel&amp;gt;
      &amp;lt;title&amp;gt;Pega Exceptions&amp;lt;/title&amp;gt;
      &amp;lt;chart&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=application $hostgroup$ $keyword$ (sourcetype=apollo:prod:pegarules) (pegarules_loglevel=ERROR OR pegarules_loglevel=SEVERE OR pegarules_loglevel=FATAL)|fields  _raw,pegarules_loglevel  |rex max_match=1 field=_raw "\.(?&amp;lt;type&amp;gt;[^\.\:]\w+(Exception|Error))(\:|\s|\;)" |search $pegaexcp$ |eval hours=strftime(_time, "%H") |where $exclude$  |timechart $timechart$ limit=30 usenull=f useother=f count by type&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;$timespan.earliest$&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;$timespan.latest$&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="charting.axisLabelsX.majorLabelStyle.overflowMode"&amp;gt;ellipsisNone&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisLabelsX.majorLabelStyle.rotation"&amp;gt;-90&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisTitleX.visibility"&amp;gt;visible&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisTitleY.visibility"&amp;gt;visible&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisTitleY2.visibility"&amp;gt;visible&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisX.scale"&amp;gt;linear&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisY.scale"&amp;gt;linear&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisY2.enabled"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisY2.scale"&amp;gt;inherit&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart"&amp;gt;column&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.bubbleMaximumSize"&amp;gt;50&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.bubbleMinimumSize"&amp;gt;10&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.bubbleSizeBy"&amp;gt;area&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.nullValueMode"&amp;gt;gaps&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.showDataLabels"&amp;gt;all&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.sliceCollapsingThreshold"&amp;gt;0.01&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.stackMode"&amp;gt;stacked&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.style"&amp;gt;shiny&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.drilldown"&amp;gt;all&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.layout.splitSeries"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.layout.splitSeries.allowIndependentYRanges"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.legend.labelStyle.overflowMode"&amp;gt;ellipsisMiddle&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.legend.placement"&amp;gt;bottom&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisTitleX.text"&amp;gt;Time&amp;lt;/option&amp;gt;
        &amp;lt;option name="height"&amp;gt;600&amp;lt;/option&amp;gt;
      &amp;lt;/chart&amp;gt;
    &amp;lt;/panel&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 23 Mar 2017 19:16:05 GMT</pubDate>
    <dc:creator>JDukeSplunk</dc:creator>
    <dc:date>2017-03-23T19:16:05Z</dc:date>
    <item>
      <title>How to create a single dashboard that will change the search for each panel based on a dropdown input option?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-single-dashboard-that-will-change-the-search-for/m-p/371767#M109391</link>
      <description>&lt;P&gt;I have created 3 dashboards which displays performance metrics and client usage of the api. All 3 dashboards have the same set of panels and all the searches used in panel are the same except that the api name is different. &lt;BR /&gt;
So I am trying to find out if there is a way to have a single dashboard and change only the api name in the search for each panel using a dropdown input.&lt;/P&gt;

&lt;P&gt;for example : &lt;BR /&gt;
api1&lt;BR /&gt;
api2&lt;BR /&gt;
api3&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* SERVICE=  ..
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So the dashboard will refresh and get results of each api every time I submit or select the different api.&lt;/P&gt;

&lt;P&gt;Please help by redirecting me to any example or steps to create the above dashboard.&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 16:30:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-single-dashboard-that-will-change-the-search-for/m-p/371767#M109391</guid>
      <dc:creator>jxt950</dc:creator>
      <dc:date>2017-03-23T16:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a single dashboard that will change the search for each panel based on a dropdown input option?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-single-dashboard-that-will-change-the-search-for/m-p/371768#M109392</link>
      <description>&lt;P&gt;hi jxt950,&lt;BR /&gt;
you can create a form input and a token for your api, than pick the api you want and the dashboard will populate&lt;BR /&gt;
some nice examples here: &lt;A href="https://docs.splunk.com/Documentation/Splunk/6.5.2/Viz/Buildandeditforms"&gt;https://docs.splunk.com/Documentation/Splunk/6.5.2/Viz/Buildandeditforms&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 18:26:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-single-dashboard-that-will-change-the-search-for/m-p/371768#M109392</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2017-03-23T18:26:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a single dashboard that will change the search for each panel based on a dropdown input option?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-single-dashboard-that-will-change-the-search-for/m-p/371769#M109393</link>
      <description>&lt;P&gt;Ill post some sample code from a dashboard does this.&lt;/P&gt;

&lt;P&gt;Here are the "filters" at the top. You can either add static entries to these, or use searched to populate them. &lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/2667i3E7CB0C4CEFEC0EE/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Now some code for what they look like&lt;/P&gt;

&lt;P&gt;This is the code for the "Host Groups" token. It auto-populates based on a search. This then fills the $hostgroup$ token in any of the search panels in the dashboard.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;input type="multiselect" searchWhenChanged="false" token="hostgroup"&amp;gt;
      &amp;lt;label&amp;gt;Host Groups&amp;lt;/label&amp;gt;
      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;index=application  sourcetype="apollo:prod:pegarules" |eval  host=upper(host) |top host limit=100 showcount=false showperc=false |sort + host&amp;lt;/query&amp;gt;
        &amp;lt;earliest&amp;gt;-15m&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
      &amp;lt;/search&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;host&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;host&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;choice value="ttapp* OR host=amusttnup80*"&amp;gt;All&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="TTAPPPEGAAG*"&amp;gt;Agent Servers&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="TTAPPPEGAWEB*"&amp;gt;Web Servers&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="TTAPPPEGACC*"&amp;gt;Call Center Servers&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="amusttnup80003 OR host=amusttnup80004"&amp;gt;NextGen Call Center&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="TTAPPPEGAAPP* OR host=TTAPPPEGAWEB*"&amp;gt;Portal (Web and App)&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="amusttnup80005 OR host=amusttnup80006 OR host=amusttnup8007 OR host=amusttnup80007 OR host=amusttnup80008"&amp;gt;NextGen Portal&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="TTAPPPEGAAPP*"&amp;gt;APP Servers&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="TTAPPPEGAADM*"&amp;gt;Admin Servers&amp;lt;/choice&amp;gt;
      &amp;lt;prefix&amp;gt;(&amp;lt;/prefix&amp;gt;
      &amp;lt;suffix&amp;gt;)&amp;lt;/suffix&amp;gt;
      &amp;lt;delimiter&amp;gt; OR &amp;lt;/delimiter&amp;gt;
      &amp;lt;valuePrefix&amp;gt;host=&amp;lt;/valuePrefix&amp;gt;
      &amp;lt;default&amp;gt;TTAPPPEGACC*&amp;lt;/default&amp;gt;
      &amp;lt;initialValue&amp;gt;TTAPPPEGACC*&amp;lt;/initialValue&amp;gt;
    &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sample search.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;panel&amp;gt;
      &amp;lt;title&amp;gt;Pega Exceptions&amp;lt;/title&amp;gt;
      &amp;lt;chart&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=application $hostgroup$ $keyword$ (sourcetype=apollo:prod:pegarules) (pegarules_loglevel=ERROR OR pegarules_loglevel=SEVERE OR pegarules_loglevel=FATAL)|fields  _raw,pegarules_loglevel  |rex max_match=1 field=_raw "\.(?&amp;lt;type&amp;gt;[^\.\:]\w+(Exception|Error))(\:|\s|\;)" |search $pegaexcp$ |eval hours=strftime(_time, "%H") |where $exclude$  |timechart $timechart$ limit=30 usenull=f useother=f count by type&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;$timespan.earliest$&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;$timespan.latest$&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="charting.axisLabelsX.majorLabelStyle.overflowMode"&amp;gt;ellipsisNone&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisLabelsX.majorLabelStyle.rotation"&amp;gt;-90&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisTitleX.visibility"&amp;gt;visible&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisTitleY.visibility"&amp;gt;visible&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisTitleY2.visibility"&amp;gt;visible&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisX.scale"&amp;gt;linear&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisY.scale"&amp;gt;linear&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisY2.enabled"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisY2.scale"&amp;gt;inherit&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart"&amp;gt;column&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.bubbleMaximumSize"&amp;gt;50&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.bubbleMinimumSize"&amp;gt;10&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.bubbleSizeBy"&amp;gt;area&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.nullValueMode"&amp;gt;gaps&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.showDataLabels"&amp;gt;all&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.sliceCollapsingThreshold"&amp;gt;0.01&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.stackMode"&amp;gt;stacked&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.style"&amp;gt;shiny&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.drilldown"&amp;gt;all&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.layout.splitSeries"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.layout.splitSeries.allowIndependentYRanges"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.legend.labelStyle.overflowMode"&amp;gt;ellipsisMiddle&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.legend.placement"&amp;gt;bottom&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisTitleX.text"&amp;gt;Time&amp;lt;/option&amp;gt;
        &amp;lt;option name="height"&amp;gt;600&amp;lt;/option&amp;gt;
      &amp;lt;/chart&amp;gt;
    &amp;lt;/panel&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Mar 2017 19:16:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-single-dashboard-that-will-change-the-search-for/m-p/371769#M109393</guid>
      <dc:creator>JDukeSplunk</dc:creator>
      <dc:date>2017-03-23T19:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a single dashboard that will change the search for each panel based on a dropdown input option?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-single-dashboard-that-will-change-the-search-for/m-p/371770#M109394</link>
      <description>&lt;P&gt;Thank you for the response &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/190478"&gt;@adonio&lt;/a&gt; &amp;amp; &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/116955"&gt;@JDukeSplunk&lt;/a&gt;. I was able to get the desired results by doing some trial and error.&lt;/P&gt;

&lt;P&gt;First I searched for app names of the APIs using the query &lt;STRONG&gt;index=(index_name) (service*) | dedup Service | table Service&lt;/STRONG&gt;.&lt;BR /&gt;
After I got the app name for all 3 APIs&lt;/P&gt;

&lt;P&gt;Second&lt;BR /&gt;
In my dashboard test input dropdown option I did the following.&lt;/P&gt;

&lt;P&gt;I set the token name as &lt;STRONG&gt;api_name&lt;/STRONG&gt;. In all dashboard panel's query I made it &lt;STRONG&gt;index=(index_name) $api_name$ ...."&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;In static option of drop down I set&lt;BR /&gt;
&lt;STRONG&gt;Name : values&lt;/STRONG&gt; of 3 APIs &lt;BR /&gt;
ex: {api-name}: {api-name-app}&lt;/P&gt;

&lt;P&gt;And In Dynamic options &lt;BR /&gt;
I put the query mentioned above in search string. Set the time for 60 minutes.&lt;BR /&gt;
kept Field name and value as &lt;STRONG&gt;Service&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;It works as I expected. The panels refresh and publish the selected APIs metrics when selected from the dropdown.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:20:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-single-dashboard-that-will-change-the-search-for/m-p/371770#M109394</guid>
      <dc:creator>jxt950</dc:creator>
      <dc:date>2020-09-29T13:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a single dashboard that will change the search for each panel based on a dropdown input option?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-single-dashboard-that-will-change-the-search-for/m-p/371771#M109395</link>
      <description>&lt;P&gt;@jxt950 - Did your answer provide a working solution to your question? If yes and you would like to close out your post, don't forget to click "Accept". Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 00:54:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-single-dashboard-that-will-change-the-search-for/m-p/371771#M109395</guid>
      <dc:creator>aaraneta_splunk</dc:creator>
      <dc:date>2017-03-24T00:54:40Z</dc:date>
    </item>
  </channel>
</rss>

