Dashboards & Visualizations

Displaying one column value as tooltip to another column for a table

AKG1_old1
Builder

Hi,

I am using one table in my dashboard. if possible I wanted to display one column values as tooltip to another column.

basically in below table Threshold value need to be displayed as tooltip when mouse rollover on Alert_Destription or Issues_Count.

alt text

0 Karma

vnravikumar
Champion

Hi

Check @kamlesh_vaghela solution in the below link.

https://answers.splunk.com/answers/705538/how-can-i-display-hidden-fields-in-a-tooltip-1.html

or

<dashboard script="tooltip.js">
  <label>tooltip</label>
  <row>
    <panel>
      <table id="rk">
        <search>
          <query>| makeresults 
| eval Alert_Description="CPU Issues (Avg Over 70% in 10mins)", Issues_Count=0,Threshold=70,Dashboard="CPU" 
| append 
    [| makeresults 
    | eval Alert_Description="GC Issues (Stop the world >= 20%)", Issues_Count=0,Threshold=20,Dashboard="GC"] 
| eval Alert_Description=Alert_Description."##".Threshold,Issues_Count=Issues_Count."##".Threshold 
| table Alert_Description,Issues_Count,Threshold,Dashboard</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">none</option>
      </table>
    </panel>
  </row>
</dashboard>

javascript:

require([
    'underscore',
    'jquery',
    'splunkjs/mvc',
    'splunkjs/mvc/tableview',
    'splunkjs/mvc/simplexml/ready!'
], function(_, $, mvc, TableView) {

    var CustomRangeRenderer = TableView.BaseCellRenderer.extend({
        canRender: function(cell) {

            return _([ 'Alert_Description','Issues_Count']).contains(cell.field);
        },
        render: function($td, cell) {
            var value = cell.value.split("##")[0];
            var tooltip = cell.value.split("##")[1];
            $td.attr('title', tooltip);
            $td.text(value);
           if(cell.field==='Issues_Count'){
                $td.text(value).addClass('numeric');
           }else{
                $td.text(value).addClass('string');
           }
        }
    });
    mvc.Components.get('rk').getVisualization(function(tableView) {
        tableView.table.addCellRenderer(new CustomRangeRenderer());
        tableView.on('rendered', function() {
            tableView.$el.find('td.range-cell').each(function() {
                $(this).parents('tr').addClass(this.className);
            });
        });
        tableView.table.render();
    });
});
0 Karma

vnravikumar
Champion

Hi @agoyal

Please try the above solutions and let us know.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...

Design, Compete, Win: Submit Your Best Splunk Dashboards for a .conf26 Pass

Hello Splunkers,  We’re excited to kick off a Splunk Dashboard contest! We know that dashboards are a primary ...

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...