Dashboards & Visualizations

Dashboard - Dynamic Property Height

danillopavan
Communicator

Hello all,

I would like to know if there is any way to implement a dynamic height for my elements on the Dashboard depending of their values. In my case I am using the element Horseshoe Meter custom app, and based on the value I would like to increase or decrease its height property value.

Thanks and regards,

Tags (1)
0 Karma
1 Solution

worshamn
Contributor

Yes there is a way, though I've got to say changing the height of the Horseshoe Meter app sounds like a strange use-case (are you sure you aren't trying to hide the panel? if you are this would not be the right way to do this). Inside your <search> element you will need to add a <done> element which will then do a condition match on whatever value your meter is using (I will assume the field count from a stats command) and set a height token like so (notice also a default height as well):

    <panel>
      <viz type="horseshoe_meter_app.horseshoe_meter">
        <search>
          <query>your search|stats count</query>
          <done>
            <condition match=" $result.count$ > 300 ">
              <set token="hsheight">500</set>
            </condition>
            <condition>
              <set token="hsheight">300</set>
            </condition>
          </done>
        </search>
        <option name="drilldown">none</option>
        <option name="height">$hsheight$</option>
      </viz>
    </panel>

You can find related information on token usage in dashboards here that covers this: http://docs.splunk.com/Documentation/Splunk/latest/Viz/tokens

View solution in original post

0 Karma

worshamn
Contributor

Yes there is a way, though I've got to say changing the height of the Horseshoe Meter app sounds like a strange use-case (are you sure you aren't trying to hide the panel? if you are this would not be the right way to do this). Inside your <search> element you will need to add a <done> element which will then do a condition match on whatever value your meter is using (I will assume the field count from a stats command) and set a height token like so (notice also a default height as well):

    <panel>
      <viz type="horseshoe_meter_app.horseshoe_meter">
        <search>
          <query>your search|stats count</query>
          <done>
            <condition match=" $result.count$ > 300 ">
              <set token="hsheight">500</set>
            </condition>
            <condition>
              <set token="hsheight">300</set>
            </condition>
          </done>
        </search>
        <option name="drilldown">none</option>
        <option name="height">$hsheight$</option>
      </viz>
    </panel>

You can find related information on token usage in dashboards here that covers this: http://docs.splunk.com/Documentation/Splunk/latest/Viz/tokens

0 Karma
Get Updates on the Splunk Community!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

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

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...