Dashboards & Visualizations

Multiple searchTemplate and searchPostProcess to populate Dashboard Panels

hogan24
Path Finder

I'm trying to create a dashboard with 9 panels. I'm fairly certain that I could, if possible, use 2 base searches to populate all 9 of my panels. However, it seems as though only one 'searchTemplate' can be used as a base search. Therefore, I'm using 1 base search to populate 4 of my panels and have to create 5 other stand-alone searches for my other 5 panels.

Using the simple XML structure, is it possible to have multiple "searchTemplates" that act as base search to populate multiple additional panels? If so, how would that be done?

Here's what I'm doing so far.... (i've removed all the extra 'option' values from the charts.) I have one 'searchTemplate' populating the data for the 4 'searchPostProcess' panels below. And then 5 other stand-alone searches. Is there a way I can have additional 'searchTemplates' and avoid doing so many stand-alone searches?

Any assistance/thoughts would be appreciated. Thanks.

<form>
  <label>DashboardTitle</label>
  <searchTemplate>source="dbmon-tail://ProdTxRpting/EligAAA" 
                  | lookup CLIENT_LOOKUP CLIENTID as submitter_id OUTPUT MNEMONIC as Mnemonic 
                  | search Mnemonic=$Mnemonic$ 
                  | stats count by realtime_db, Mnemonic, aaa_cd</searchTemplate>
  <fieldset autoRun="true" submitButton="false">
    <input type="time" searchWhenChanged="true">
      <label>Select Date Range:</label>
      <default>
        <earliestTime>-1d@d</earliestTime>
        <latestTime>@d</latestTime>
      </default>
    </input>
    <input type="text" token="Mnemonic">
      <label>Enter a Mnemonic:</label>
      <default>*</default>
    </input>
  </fieldset>
  <row>
    <single>
      <searchString>source="dbmon-tail://ProdTxRpting/EligAAA" realtime_db=1 
                    | lookup CLIENT_LOOKUP CLIENTID as submitter_id OUTPUT MNEMONIC as Mnemonic 
                    | search Mnemonic=$Mnemonic$ 
                    | stats dc(elig_detail_id) as TXs 
                    | eval TXs = tostring(TXs, "commas")</searchString>
      <earliestTime>$earliest$</earliestTime>
      <latestTime>$latest$</latestTime>
      <option name="underLabel">IBM TXs with at least 1 AAA</option>
      <option name="linkView">search</option>
    </single>
    <single>
      <searchString>source="dbmon-tail://ProdTxRpting/EligAAA" realtime_db=0 
                    | lookup CLIENT_LOOKUP CLIENTID as submitter_id OUTPUT MNEMONIC as Mnemonic 
                    | search Mnemonic=$Mnemonic$ 
                    | stats dc(elig_detail_id) as TXs 
                    | eval TXs = tostring(TXs, "commas")</searchString>
      <earliestTime>$earliest$</earliestTime>
      <latestTime>$latest$</latestTime>
      <option name="underLabel">JCAPS TXS with at least 1 AAA</option>
      <option name="linkView">search</option>
    </single>
  </row>
  <row grouping="2,1">
    <single>
      <searchString>source="dbmon-tail://ProdTxRpting/EligDetailIBM" 
                    | lookup CLIENT_LOOKUP CLIENTID as submitter_id OUTPUT MNEMONIC as Mnemonic 
                    | search Mnemonic=$Mnemonic$ 
                    | chart dc(trxn_detail_group_id) as HubReceivedTXs 
                    | eval HubReceivedTXs = tostring(HubReceivedTXs, "commas")</searchString>
      <earliestTime>$earliest$</earliestTime>
      <latestTime>$latest$</latestTime>
    </single>
    <single>
      <searchString>source="dbmon-tail://ProdTxRpting/EligDetailIBM" 
                    | lookup CLIENT_LOOKUP CLIENTID as submitter_id OUTPUT MNEMONIC as Mnemonic 
                    | search Mnemonic=$Mnemonic$ 
                    | stats dc(trxn_detail_group_id) as HubReceivedTXs count 
                    | eval NewField1=count-HubReceivedTXs 
                    | eval NewField2 = tostring(NewField1, "commas") 
                    | table NewField2</searchString>
      <earliestTime>$earliest$</earliestTime>
      <latestTime>$latest$</latestTime>
    </single>
    <single>
      <searchString>source="dbmon-tail://ProdTxRpting/EligDetailJCAPS" 
                    | lookup CLIENT_LOOKUP CLIENTID as submitter_id OUTPUT MNEMONIC as Mnemonic 
                    | search Mnemonic=$Mnemonic$ 
                    | chart count as HubReceivedTXs 
                    | eval HubReceivedTXs = tostring(HubReceivedTXs, "commas")</searchString>
      <earliestTime>$earliest$</earliestTime>
      <latestTime>$latest$</latestTime>
    </single>
  </row>
  <row>
    <chart>
      <title>IBM</title>
      <searchPostProcess>| where realtime_db=1 
                         | chart sum(count) as Count by aaa_cd 
                         | sort -Count</searchPostProcess>
    </chart>
    <chart>
      <title>JCAPS</title>
      <searchPostProcess>| where realtime_db=0 
                         | chart sum(count) as Count by aaa_cd 
                         | sort -Count</searchPostProcess>
    </chart>
  </row>
  <row>
    <chart>
      <title>IBM</title>
      <searchPostProcess>| where realtime_db=1 
                         | chart sum(count) as Count by Mnemonic 
                         | sort -Count 
                         | head 10</searchPostProcess>
    </chart>
    <chart>
      <title>JCAPS</title>
      <searchPostProcess>| where realtime_db=0 
                         | chart sum(count) as Count by Mnemonic 
                         | sort -Count 
                         | head 10</searchPostProcess>
    </chart>
  </row>
</form>
1 Solution

dmillis
Splunk Employee
Splunk Employee

dmillis
Splunk Employee
Splunk Employee

norbert_hamel
Communicator

Hi,

you could turn your dashboard to HTML, where you can use multiple base searches 🙂

Cheers
Norbert

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...