Dashboards & Visualizations

Why does cell_fill_gauge.js not work on all panels in my dashboard?

lycollicott
Motivator

Why doesn't this dashboard use cell_fill_gauge.js?

alt text

<dashboard hideEdit="false" script="cell_fill_gauge.js,common_control.js">
  <label>Summary TEST</label>
  <row>
    <panel>
      <table>
        <search>
          <query>| rest splunk_server=*idnd01 /services/server/status/partitions-space
| join type=outer splunk_server, mount_point [
  | rest splunk_server=*idnd01 /services/server/status/resource-usage/iostats
  | eval iops = round(reads_ps + writes_ps)
  | fields splunk_server, mount_point, iops, cpu_pct]
| eval free = if(isnotnull(available), available, free)
| eval usage = round((capacity - free) / 1024, 2)
| eval capacity = round(capacity / 1024, 2)
| eval compare_usage = usage." / ".capacity
| eval pct_usage = round(usage / capacity * 100, 2) 
| stats first(compare_usage) as compare_usage by splunk_server, mount_point
| rename splunk_server as "Indexer", mount_point as "Mount Point", compare_usage as "Disk Usage (GB)"
| streamstats current=false last(Indexer) as PrevIndexer
| eval Indexer=if(match(Indexer,PrevIndexer),"",Indexer)
| fields - PrevIndexer</query>
          <earliest>0</earliest>
          <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">false</option>
        <option name="totalsRow">false</option>
        <option name="wrap">true</option>
      </table>
    </panel>
  </row>
</dashboard>
0 Karma
1 Solution

martin_mueller
SplunkTrust
SplunkTrust

Assuming your dashboard is in a different app, you will need to prefix the script attribute with splunk_monitoring_console: to tell Splunk where to look.

A word of warning, this is no documented or supported interface - hence it can change or disappear without notice on any upgrade of Splunk. If you want a more reliable future you should make a copy.

Another word of warning, around line 200 that script seems to add its cell renderers to tables called table1 and table2... depending on how your dashboard is generated from SimpleXML, those IDs may or may not match. I'd recommend defining your own IDs and then adding the renderers specifically to those IDs.

View solution in original post

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Assuming your dashboard is in a different app, you will need to prefix the script attribute with splunk_monitoring_console: to tell Splunk where to look.

A word of warning, this is no documented or supported interface - hence it can change or disappear without notice on any upgrade of Splunk. If you want a more reliable future you should make a copy.

Another word of warning, around line 200 that script seems to add its cell renderers to tables called table1 and table2... depending on how your dashboard is generated from SimpleXML, those IDs may or may not match. I'd recommend defining your own IDs and then adding the renderers specifically to those IDs.

View solution in original post

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Without knowing what the script does I can only guess.

  • is the script loaded in the browser? If not, figure out if it's sitting in the right path and possibly restart Splunk if it was just added.
  • any errors in the JS console?
  • does the script refer to a table view by an ID? If so, give your table that ID.

lycollicott
Motivator

It is a builtin part of Splunk: etc\apps\splunk_monitoring_console\appserver\static\cell_fill_gauge.js

There are no errors.

The .js does have code that defines table1 & table 2, but it only looks like definition and I can't see how it uses the definition. (I'm definitely not a .js dude though, so I could be full of crap about that.)

The script get used in lots of DMC screens like "Indexes and Volumes: Instance" and I made a custom executive summary dashboard based on a clone of one of those from the DMC.

0 Karma