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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...