Splunk Search

How to add a color to the field in one column based on the other column filed values

msr
New Member

Hi,

How can I add a color to the field in one column based on the other column filed values? The example below, I need to display service filed green if the status is running and red if the status is down.                            

service  status     
McAfee EPO   down
Symantec DLP running 

            

 

Labels (2)
Tags (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Add some css in the panel above your table and give your table an id

      <html>
        <style>
          #tableservicestatus table tbody td div.multivalue-subcell[data-mv-index="1"]{
            display: none;
          }
        </style>
      </html>
      <table id="tableservicestatus">

Then convert your field to a mv with the status

--- your query
| eval service=service."|".status
| eval service=split(service,"|")

 Then colour the field based on the value (of the mv)

        <format type="color" field="service">
          <colorPalette type="expression">case (match(value,"down"), "rgb(255,0,0)",match(value,"running"),"rgb(0,255,0)")</colorPalette>
        </format>
0 Karma
Get Updates on the Splunk Community!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk on November 6 at 11AM PT, and empower your SOC to reach new heights! Duration: ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...