<?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: prebuilt panels - condition the behaviour in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/prebuilt-panels-condition-the-behaviour/m-p/454980#M29841</link>
    <description>&lt;P&gt;Hi  thambisetty,&lt;/P&gt;

&lt;P&gt;Thx for your answer.&lt;/P&gt;

&lt;P&gt;I actually use base search in my code. I just sent a portion of my code so it was not part of it.&lt;BR /&gt;
I need to create a dashboard with multiple charts which are exactly the same, except for 2 variables taken from dropdown lists.&lt;/P&gt;

&lt;P&gt;My intention was to mimic a some looping here.&lt;BR /&gt;
I dont want to write and maintain exactly the same code (almost) on many rows and panels, so I thought to use a prebuilt panel that can get a value as an input to a var used in the panel.&lt;/P&gt;

&lt;P&gt;Any idea how to achieve loop in the XML code?&lt;/P&gt;

&lt;P&gt;Thx again&lt;BR /&gt;
Guy&lt;/P&gt;</description>
    <pubDate>Tue, 24 Jul 2018 18:43:36 GMT</pubDate>
    <dc:creator>gravid</dc:creator>
    <dc:date>2018-07-24T18:43:36Z</dc:date>
    <item>
      <title>prebuilt panels - condition the behaviour</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/prebuilt-panels-condition-the-behaviour/m-p/454978#M29839</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm having a predefined panel which I want to reuse in the same dashboard.&lt;BR /&gt;
Each "instantiation" of the panel (using panel ref=panel_name) needs to do a slight different search.&lt;/P&gt;

&lt;P&gt;Is there a way to control it?&lt;BR /&gt;
something like:&lt;BR /&gt;
panel ref="my_panel" myVar="hello"&lt;/P&gt;

&lt;P&gt;in the predefined panel:&lt;BR /&gt;
panel&lt;BR /&gt;
        query&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;      index="playground4" Name="ABC*" 
      | eval FACTOR=$my_var  | rest of the code...


      query
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;panel&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jul 2018 14:18:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/prebuilt-panels-condition-the-behaviour/m-p/454978#M29839</guid>
      <dc:creator>gravid</dc:creator>
      <dc:date>2018-07-24T14:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: prebuilt panels - condition the behaviour</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/prebuilt-panels-condition-the-behaviour/m-p/454979#M29840</link>
      <description>&lt;P&gt;Hi @gravid,&lt;/P&gt;

&lt;P&gt;I think you are looking for base search.&lt;/P&gt;

&lt;P&gt;what is base search?&lt;BR /&gt;
Base is search something master search and this search results can be used in multiple panels by using the id of it.&lt;BR /&gt;
Below is the sample code shows that search id="base" results will be used in panel1.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
&amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="my_var" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Factor&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
 &amp;lt;search id="base"&amp;gt;
    &amp;lt;query&amp;gt;index="playground4" Name="ABC*"  FACTOR=$my_var$
&amp;lt;earliest&amp;gt;$earliest$&amp;lt;/earliest&amp;gt;
    &amp;lt;latest&amp;gt;$latest$&amp;lt;/latest&amp;gt;
  &amp;lt;/search&amp;gt;
&amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;chart&amp;gt;
        &amp;lt;title&amp;gt;panel1&amp;lt;/title&amp;gt;
        &amp;lt;search base="base"&amp;gt;
          &amp;lt;query&amp;gt;| additional query&amp;lt;/query&amp;gt;
        &amp;lt;/search&amp;gt;
      &amp;lt;/chart&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>Tue, 24 Jul 2018 18:34:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/prebuilt-panels-condition-the-behaviour/m-p/454979#M29840</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2018-07-24T18:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: prebuilt panels - condition the behaviour</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/prebuilt-panels-condition-the-behaviour/m-p/454980#M29841</link>
      <description>&lt;P&gt;Hi  thambisetty,&lt;/P&gt;

&lt;P&gt;Thx for your answer.&lt;/P&gt;

&lt;P&gt;I actually use base search in my code. I just sent a portion of my code so it was not part of it.&lt;BR /&gt;
I need to create a dashboard with multiple charts which are exactly the same, except for 2 variables taken from dropdown lists.&lt;/P&gt;

&lt;P&gt;My intention was to mimic a some looping here.&lt;BR /&gt;
I dont want to write and maintain exactly the same code (almost) on many rows and panels, so I thought to use a prebuilt panel that can get a value as an input to a var used in the panel.&lt;/P&gt;

&lt;P&gt;Any idea how to achieve loop in the XML code?&lt;/P&gt;

&lt;P&gt;Thx again&lt;BR /&gt;
Guy&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jul 2018 18:43:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/prebuilt-panels-condition-the-behaviour/m-p/454980#M29841</guid>
      <dc:creator>gravid</dc:creator>
      <dc:date>2018-07-24T18:43:36Z</dc:date>
    </item>
  </channel>
</rss>

