Splunk Search

How to exclude a field in foreach?

HeinzWaescher
Motivator

Hi,

is it possible to exclude one specific field in the foreach command?
Currently it looks like this, but I want to exclude the "size" field here:

| foreach * [eval <<FIELD>>=round('<<FIELD>>'/size*100, 2)]

Cheers
Heinz

0 Karma
1 Solution

javiergn
Super Champion

Try this:

| foreach * [eval <<FIELD>>=if("<<FIELD>>" == "size", size, round('<<FIELD>>'/size*100, 2))]

View solution in original post

javiergn
Super Champion

Try this:

| foreach * [eval <<FIELD>>=if("<<FIELD>>" == "size", size, round('<<FIELD>>'/size*100, 2))]

HeinzWaescher
Motivator

Awesome, thanks a lot!

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

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

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...