Splunk Search

How to make the column one color?

robertlynch2020
Influencer

Hi

I have a table with TEXT, i have 3 columns.

| table no1 no2 email

I want the column email to be gray, I cant seem to do this with the current options, they are based on numbers, or am i missing something.

How can i set a wild character to do this? As start does not work

  ![<format type="color" field="email_address">
          <colorPalette type="map">{"*":#708794,"Unknown":#708794}</colorPalette>
        </format>][1]

Rob

0 Karma
1 Solution

renjith_nair
Legend

@robertlynch2020 ,

If you want only one color, just use list and add only grey to the list.

        <format type="color" field="email_address">
          <colorPalette type="list">[#708794] </colorPalette>
        </format>   
---
What goes around comes around. If it helps, hit it with Karma 🙂

View solution in original post

renjith_nair
Legend

@robertlynch2020 ,

If you want only one color, just use list and add only grey to the list.

        <format type="color" field="email_address">
          <colorPalette type="list">[#708794] </colorPalette>
        </format>   
---
What goes around comes around. If it helps, hit it with Karma 🙂

robertlynch2020
Influencer

perfect thanks 🙂

0 Karma

niketn
Legend

@robertlynch2020 here is another one of colorPalette option that would work. The expression type allows you to enter regular expression based matches for coloring table cells. PS: Complex regular expression does not seem to work.

    <format type="color" field="email">
      <colorPalette type="expression">if (value == ".*", "#708794", "#708794")</colorPalette>
    </format>

Refer to Splunk Documentation: https://docs.splunk.com/Documentation/Splunk/latest/Viz/TableFormatsXML#Color_palette_types_and_opti...

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

vnravikumar
Champion

Hi

Try this

<dashboard  script="table_cell_highlighting.js" stylesheet="table_cell_highlighting.css">
  <label>tablecolor</label>
  <row>
    <panel>
      <table id="highlight">
        <search>
          <query>| makeresults 
| eval no1=1, no2=2, email="test@test.com" 
| append 
    [| makeresults 
    | eval no1=4, no2=3, email="test1@test.com"] 
| table no1 no2 email</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">none</option>

      </table>
    </panel>
  </row>
</dashboard>

table_cell_highlighting.js:

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

      var CustomRangeRenderer = TableView.BaseCellRenderer.extend({
          canRender: function(cell) {
              return _(['email']).contains(cell.field);
          },
          render: function($td, cell) {
              var value = cell.value;
              if (cell.field === 'email') {
                      $td.addClass('range-cell').addClass('background');
              }
              $td.text(value);
          }
      });
      mvc.Components.get('highlight').getVisualization(function(tableView) {
          // Add custom cell renderer, the table will re-render automatically.
          tableView.addCellRenderer(new CustomRangeRenderer());
      });
  });

table_cell_highlighting.css: you can apply any required styles here

#highlight td.background {
    background-color: rgb(202, 204, 204) !important;
        font-weight: bold;
}
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!

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 ...

Network to App: Observability Unlocked [May & June Series]

In today’s digital landscape, your environment is no longer confined to the data center. It spans complex ...