Archive

Hide a Panel in a Dashboard

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

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

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

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!!

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
State of Splunk Careers

Access the Splunk Careers Report to see real data that shows how Splunk mastery increases your value and job satisfaction.

Find out what your skills are worth!