Splunk Search

Splunk

vinod0313
Explorer

Hello

I have a log like this:

ABC=true,DEF=false,GHI=false,JKL=true


I want to show only ABC and JKL in the result,because these are having value as true.

Result should be like below


ABC
JKL

Labels (1)
0 Karma

to4kawa
Ultra Champion

index=_internal | head 1 | fields _raw
| eval _raw="ABC=true,DEF=false,GHI=false,JKL=true"
| rename COMMENT as "this is sample"

| kv
| eval col="1"
| table col *
| untable col field value
| where value="true"

0 Karma

vinod0313
Explorer

That is not a static log,it is dynamic log

ABC=TRUE or FALSE depend upon Source The ABC value may differ 
so if the value of ABC=TRUE then we have to show ABC in result other wise No.

0 Karma

rnowitzki
Builder

Hi @vinod0313 ,

@to4kawa's option is dynamic like that.  You only need the part starting with | kv
The lines above were just to make up some sample data.

You can change ABC to ACB or ACAB or whatever your data will have - only the ones with "true" as value will be listed. Give it a try 🙂

BR
Ralph

--
Karma and/or Solution tagging appreciated.
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...

Keep the Learning Going with the New Best of .conf Hub

Hello Splunkers, With .conf26 getting closer, there’s already a lot of excitement building around this year’s ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...