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!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  &#x1f680; Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...