Dashboards & Visualizations

How to add a static table in dashboard?

splunkrocks2014
Communicator

I added a following table to my dashboard mainly to show the legends from a statistics table. The table showed the legends and contents properly, but the statistics table did not work any more. I guess this is not the right way to add a static table to the Splunk dashboard. Any suggestion? Thanks.

<form>        
              ...
             <option name="count">100</option>
          </table>
        </panel>
      </row>
      <row>
        <panel>
          <html>
            <center>
            <table id="legend" style="width:80%;text-align:center">
            <tr>
              <td style="width:20%;background-color:#4B4B4B;color:white;">legend_1</td>
              <td style="width:20%;background-color:#C8A2C8;color:white;">legend_2</td>
              <td style="width:20%;background-color:#DF3737;color:white;">legend_3</td>
              <td style="width:20%;background-color:#FFA100;color:white;">legend_4</td>
              <td style="width:20%;background-color:#15B85E;color:white;">legend_5</td>
              </tr>
            </table>
            </center>
           </html>
        </panel>
      </row>
</form>
0 Karma

woodcock
Esteemed Legend

Here is some sample XML that demonstrates coloring of cells (the colorPalette part) in a Statistics Table depending on values:

<panel>
  <title>Your Title Here</title>
  <table>
    <title>Your Other Title Here</title>
    <search>
      <query>Your Search Query That Generates A Table Here</query>
      <earliest>$earliest$</earliest>
      <latest>$latest$</latest>
    </search>
    <option name="count">2</option>
    <option name="dataOverlayMode">none</option>
    <option name="drilldown">cell</option>
    <option name="percentagesRow">false</option>
    <option name="rowNumbers">false</option>
    <option name="totalsRow">false</option>
    <option name="wrap">true</option>
    <format type="color" field="count">
      <colorPalette type="map">{"1000":#A2CC3E,"10000":#F7BC38,"50000":#F7BC38,"100000":#A2CC3E,"101000":#D93F3C}</colorPalette>
    </format>
  </table>
</panel>
0 Karma

somesoni2
Revered Legend

What version of Splunk this html doesn't work??

0 Karma

splunkrocks2014
Communicator

Splunk version 6.3.7

0 Karma

somesoni2
Revered Legend

Above simple xml snippet for html tag worked fine for me in 6.3.8. When you say "but the statistics table did not work any more", what doesn't work? you don't see colors or what?

0 Karma

splunkrocks2014
Communicator

From the statistics table, it shows as "Search is waiting for input...", but it never shows any results.

0 Karma

somesoni2
Revered Legend

It's output of an html code so, changing the panel type to statistics table would not fetch anything (not sure if that's possible). If you're looking to recreate the same html panel as Splunk statistics table, will colored cell, first you need to write a Splunk search to return the table in the format that you need and then you need to use methods described in below links to color the cells.

https://answers.splunk.com/answers/230164/how-to-get-a-table-cell-color-to-change-depending.html
https://answers.splunk.com/answers/418487/how-to-set-up-table-cell-highlighting-with-differe.html

0 Karma
Get Updates on the Splunk Community!

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

Splunk Decoded: Business Transactions vs Business IQ

It’s the morning of Black Friday, and your e-commerce site is handling 10x normal traffic. Orders are flowing, ...

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...