All Apps and Add-ons

How to decrease the Size of a single value panel?

theouhuios
Motivator

Hello

I am trying to decrease the size of the single value panel in a view to utilize the space more efficiently using Sideview

alt text

I want to place the single value in the 2nd row in 1st row itself. Can we have 4 panels in a row? If we decrease the space occupied by single value in row 1 can we have the value in row 2 move to row 1?

1 Solution

sideview
SplunkTrust
SplunkTrust

Sure. To be honest if you're using Sideview Utils the best thing to do with SingleValue is to not use it.

In the simplest form, you can use the HTML module to write out a single value like so:

<module name="HTML">
  <param name="html"><![CDATA[
    <b>total KB = $results[0].sumKB$</b>
  ]]></param>
</module>

To more closely approximate the look and feel of the grey SingleValue elements:

<module name="HTML">
  <param name="html"><![CDATA[
    <div class="valueDisplay">
      <div class="inner"><b>total KB = $results[0].sumKB$</b></div>
    </div>
    <br clear="all">
  ]]></param>
</module>

And there's a whole docs page in Sideview Utils specifically about using the HTML module instead of SingleValue.

In the app itself navigate to "Module Documentation > the HTML Module > Using HTML instead of the SingleValue Module."

I'm not sure where exactly you want to have the two values displayed. One thing I can say is that you cannot have 4 panels in a row.

However you can sneak the HTML modules into the same panels as your charts - just have them render into those panels after the JSCharts and they'll be in the same panel but underneath.

And if you put the HTML module together with a standalone search module to run it, here's what it looks like:

<module name="Search" layoutPanel="panel_row2_col1" >
  <param name="search">index=_internal source=*metrics.log group=per_sourcetype_thruput | stats sum(kb) as sumKB avg(eps) as avgEPS by series | sort - sumKB | head 1</param>
  <param name="earliest">-15min</param>

  <module name="HTML">
    <param name="html"><![CDATA[
      <div class="valueDisplay">
        <div class="inner"><b>total KB = $results[0].sumKB$</b></div>
      </div>
      <br clear="all">
    ]]></param>
  </module>
</module>

Also If you need to do the fancy background-coloring stuff that SingleValue can do keyed off the rangemap command, there are examples of that too in the docs.

View solution in original post

sideview
SplunkTrust
SplunkTrust

Sure. To be honest if you're using Sideview Utils the best thing to do with SingleValue is to not use it.

In the simplest form, you can use the HTML module to write out a single value like so:

<module name="HTML">
  <param name="html"><![CDATA[
    <b>total KB = $results[0].sumKB$</b>
  ]]></param>
</module>

To more closely approximate the look and feel of the grey SingleValue elements:

<module name="HTML">
  <param name="html"><![CDATA[
    <div class="valueDisplay">
      <div class="inner"><b>total KB = $results[0].sumKB$</b></div>
    </div>
    <br clear="all">
  ]]></param>
</module>

And there's a whole docs page in Sideview Utils specifically about using the HTML module instead of SingleValue.

In the app itself navigate to "Module Documentation > the HTML Module > Using HTML instead of the SingleValue Module."

I'm not sure where exactly you want to have the two values displayed. One thing I can say is that you cannot have 4 panels in a row.

However you can sneak the HTML modules into the same panels as your charts - just have them render into those panels after the JSCharts and they'll be in the same panel but underneath.

And if you put the HTML module together with a standalone search module to run it, here's what it looks like:

<module name="Search" layoutPanel="panel_row2_col1" >
  <param name="search">index=_internal source=*metrics.log group=per_sourcetype_thruput | stats sum(kb) as sumKB avg(eps) as avgEPS by series | sort - sumKB | head 1</param>
  <param name="earliest">-15min</param>

  <module name="HTML">
    <param name="html"><![CDATA[
      <div class="valueDisplay">
        <div class="inner"><b>total KB = $results[0].sumKB$</b></div>
      </div>
      <br clear="all">
    ]]></param>
  </module>
</module>

Also If you need to do the fancy background-coloring stuff that SingleValue can do keyed off the rangemap command, there are examples of that too in the docs.

theouhuios
Motivator

That worked. Thanks 🙂

0 Karma
Get Updates on the Splunk Community!

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

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

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...