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!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...