Splunk Search

How to exclude values from evaluation ?

zacksoft
Contributor

I have a list of values for trans_time field ranging from 0 to 45000 (not continious values).
I am performing some calculations on it such as average, summation etc...

I only want to perform my eval calculations on values from until 1500. I have sorted the trans_time field. How to set up the condition such as all the follow up evals will only be calculated from 0 to 1500. All the values above should just be excluded.

Tags (1)
0 Karma
1 Solution

elliotproebstel
Champion

If you want to exclude from your calculations all events where trans_time<=1500, then you can add exactly that to your base search. So, for example, if your base search was index=main sourcetype=some_data, then you would change it to index=main sourcetype=some_data trans_time<=1500. If the trans_time field doesn't appear in your base search and is created by calculations earlier in the search pipeline, then you can add | search trans_time<=1500 after the field is created.

View solution in original post

0 Karma

elliotproebstel
Champion

If you want to exclude from your calculations all events where trans_time<=1500, then you can add exactly that to your base search. So, for example, if your base search was index=main sourcetype=some_data, then you would change it to index=main sourcetype=some_data trans_time<=1500. If the trans_time field doesn't appear in your base search and is created by calculations earlier in the search pipeline, then you can add | search trans_time<=1500 after the field is created.

0 Karma

493669
Super Champion

have you tried

| sort 1500 -_time
0 Karma

zacksoft
Contributor

It shows the first 1500 items..
and my trans_time values are not continiuos like (1, 2, 3, 4 ..3tc..) they are more like 1, 8, 4, 13, 19 ...)
I just need to make sure that I operate only on values from trans_time field whose value is less than 1500.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

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

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...

Index This | How many sevens are there between 1 and 100?

August 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this ...