Splunk Search

Color a word in a field/Splunk Result

kirti_gupta12
Path Finder

I have a Splunk query:

 

index=my_index cf_app_name=$app_name$ msg!="*Hikari*" $log_type$ | sort -_time | table msg

 

It populates Splunk with results. 

Now, the msg field has log_type as INFO, ERROR, WARNING. Example:

 

2021-11-17 15:03:34.921  INFO 22 --- [ taskExecutor-1] c.c.p.r.e.EventService            : Event sent to event ID: 2111 - REPRICING has finished

2021-11-16 22:23:54.905 ERROR 22 --- [ taskExecutor-1] c.c.p.r.service.SftpService           : Could not delete file: /-/PCS.P.KSZ4750J.TRIG.FILE - 4: Failure

2021-11-16 22:23:54.905 WARNING 22 --- [ taskExecutor-1] c.c.p.r.service.SftpService           : Could not delete file: /-/PCS.P.KSZ4750J.TRIG.FILE - 4: Failure

 

Now, My goals is to COLOR the log_type field in the "msg" to Green if it's INFO, Red if it's ERROR, and Yellow if it's WARNING. 

I don't want to color the entire msg field, just the words INFO, ERROR and WARNING should be turned to those specific colors. 

@scelikok @somesoni2 

Labels (4)
Tags (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Assuming you are using the standard table viz, this is not possible; you would need to split the message up into different fields and then just colour the field with the log type in.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

What Is Splunk? Here’s What You Can Do with Splunk

Hey Splunk Community, we know you know Splunk. You likely leverage its unparalleled ability to ingest, index, ...

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...

Manual Instrumentation with Splunk Observability Cloud: How to Instrument Frontend ...

Although it might seem daunting, as we’ve seen in this series, manual instrumentation can be straightforward ...