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!

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...

Cloud Monitoring Console - Unlocking Greater Visibility in SVC Usage Reporting

For Splunk Cloud customers, understanding and optimizing Splunk Virtual Compute (SVC) usage and resource ...

Automatic Discovery Part 3: Practical Use Cases

If you’ve enabled Automatic Discovery in your install of the Splunk Distribution of the OpenTelemetry ...