Dashboards & Visualizations

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

din98
Explorer




Labels (1)
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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...