Splunk Search

How to return a list of field names vs field values?

Runals
Motivator

I'm trying to have Splunk build a list of field names where the values in the fields meet some criteria - note though that I want the field names not the values. The search might look something like:

... | eval updated = "" | foreach * [eval updated = if(<<FIELD>> >1,  <fieldname> . " " .updated , updated)]

I get `` isn't going to work - logically though, that is what I'm trying to achieve. If there is a different/better way, I'm all ears.

Tags (2)
0 Karma
1 Solution

Runals
Motivator

/sigh

Helps to read the documentation closer. You simply need to wrap the <> bit in double quotes. I thought I had seen this somewhere

... | eval updated = "" | foreach * [eval updated = if(<<FIELD>> >1, "<<FIELD>>". " " updated, updated)]

View solution in original post

Runals
Motivator

/sigh

Helps to read the documentation closer. You simply need to wrap the <> bit in double quotes. I thought I had seen this somewhere

... | eval updated = "" | foreach * [eval updated = if(<<FIELD>> >1, "<<FIELD>>". " " updated, updated)]

sherm77
Path Finder

@Runals thanks for giving the answer instead of leaving us hanging. I have facepalm regularly, I might as well put a sticker of a hand on my cheek 🙂

jagadeeshm
Contributor

How can we get both fields and their respective values?

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

Splunk is officially part of Cisco

Revolutionizing how our customers build resilience across their entire digital footprint.   Splunk ...

Splunk APM & RUM | Planned Maintenance March 26 - March 28, 2024

There will be planned maintenance for Splunk APM and RUM between March 26, 2024 and March 28, 2024 as ...