Dashboards & Visualizations

Hide a Panel in a Dashboard

g038123
Explorer

I have a Dashboard that allows a user to select a model number from a drop down and then input a list of serial numbers in a text box.
I have added a second SPL query to the dashboard with the sole purpose of formatting each serial value to prefix/suffix with a tick and separate each value by a comma delimiter like the following example '12345',23456',34567',......etc. Everything works great.

What I'd like to do is hide the panel (the first panel in the code listed below) that is present in the dashboard for the search I've built in to format the serial list.
I know I'm missing something very obvious but can't seem to get anything working.
My code is below, would love a little help

<form theme="dark">
  <label>New Dashboard</label>
  <fieldset submitButton="true" autoRun="false">
  <input type="dropdown" token="model_tok">
  <label>Select Model Number</label>
  <choice value="1011">2222</choice>
  <choice value="1010">3333</choice>
  <choice value="2000">4444</choice>
  <choice value="4000">5555</choice>
</input>
<input type="text" token="serial_tok">
  <label>Input Serial Number(s)</label>
</input>
</fieldset>
<row>
  <panel>
    <table>
      <search>
        <query>|makeresults | eval input_sql="$serial_tok$" | makemv delim=" " input_sql | mvexpand input_sql | eval input_sql="'".input_sql."'" | mvcombine delim="," input_sql | nomv input_sql</query>
      <earliest>-5m@m</earliest>
      <latest>now</latest>
      <done>
        <set token="input_sql">$result.input_sql$</set>
      </done>
    </search>
    <option name="count">1</option>
    <option name="drilldown">none</option>
  </table>
</panel>
</row>
<row>
 <panel>
  <table>
    <search>
      <query>| dbxquery base query</query>
      <earliest>@d</earliest>
      <latest>now</latest>
      <sampleRatio>1</sampleRatio>
    </search>
    <option name="count">100</option>
    <option name="dataOverlayMode">none</option>
    <option name="drilldown">none</option>
    <option name="percentagesRow">false</option>
    <option name="rowNumbers">true</option>
    <option name="totalsRow">false</option>
    <option name="wrap">true</option>
  </table>
</panel>
</row>
</form>`

Hopefully this makes sense, in a nutshell, I would simply like to hide the panel for the search that formats the serial list.

0 Karma
1 Solution

jpolvino
Builder

If you're trying to hide the panel starting at row 15, you can try this in place of row 15:
<row depends=$foo$>

This will only show that row when the foo token exists, which it doesn't.

BTW, this is a great resource for dashboarding: https://docs.splunk.com/Documentation/Splunk/7.1.0/Viz/PanelreferenceforSimplifiedXML

View solution in original post

0 Karma

jpolvino
Builder

If you're trying to hide the panel starting at row 15, you can try this in place of row 15:
<row depends=$foo$>

This will only show that row when the foo token exists, which it doesn't.

BTW, this is a great resource for dashboarding: https://docs.splunk.com/Documentation/Splunk/7.1.0/Viz/PanelreferenceforSimplifiedXML

0 Karma

g038123
Explorer

Thank you so much, like I said in my original post, "missing something obvious".
Feels like a forest through the tress moment.

Thank you jpolvino, worked perfectly!!

jpolvino
Builder

Glad to help. That technique is also an effective way to dynamically hide rows and panels and have them show for only certain criteria. This gives a more polished experience. The link has a lot of useful content.

0 Karma
Get Updates on the Splunk Community!

Enter the Dashboard Challenge and Watch the .conf24 Global Broadcast!

The Splunk Community Dashboard Challenge is still happening, and it's not too late to enter for the week of ...

Join Us at the Builder Bar at .conf24 – Empowering Innovation and Collaboration

What is the Builder Bar? The Builder Bar is more than just a place; it's a hub of creativity, collaboration, ...

Combine Multiline Logs into a Single Event with SOCK - a Guide for Advanced Users

This article is the continuation of the “Combine multiline logs into a single event with SOCK - a step-by-step ...