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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...