Dashboards & Visualizations

How to combine similar and different values of two fields together?

din98
Explorer




Labels (2)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @din98 ,

you have to normalize your field and I hint to do this in a calculated field and not in your search.

In few word, you have to create two eval commands like thie following:

| eval 
   state1=case(state1="Completed","Successful",state1="Faulted","Successful"),
   state2=case(state2="Completed","Successful",state2="Faulted","Successful")

you can try them in a search, but after the test I hint to put then in two calculated fields.

then in the search use the coalesce option in the eval command

| eval state=coalesce(state1,state2)

Ciao.

Giuseppe

0 Karma

din98
Explorer

 ,

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @din98,

you can add all the conditions you have, I don't know if it's possible in your logs, but you could have:

| eval 
   state1=case(state1="Completed","Successful",state1="Faulted","Successful",state2="Pending","Pending"),
   state2=case(state2="Completed","Successful",state2="Faulted","Successful",state2="Pending","Pending")

Ciao.

Giuseppe

0 Karma
Get Updates on the Splunk Community!

Observability | How to Think About Instrumentation Overhead (White Paper)

Novice observability practitioners are often overly obsessed with performance. They might approach ...

Cloud Platform | Get Resiliency in the Cloud Event (Register Now!)

IDC Report: Enterprises Gain Higher Efficiency and Resiliency With Migration to Cloud  Today many enterprises ...

The Great Resilience Quest: 10th Leaderboard Update

The tenth leaderboard update (11.23-12.05) for The Great Resilience Quest is out >> As our brave ...