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!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  &#x1f680; Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...