Splunk Search

Remove all events of a client based on one or more values of field

rel82wi
Engager

Hi there

Im trying to filter my search results based on numerical top values of a field.

For example. I have 5k events as customer purchases. I want a list of all customers, who have never paid more than 10.

Or the other way, I want to filter out all customer events of customers, which have a purchase event with a value in a field higher than 10.

Which command could I use?

delete removes the events from the index. I only want to filter my search results.

if i filter for "field<=10" I do only get the events that have purchases, which are smaller than 10, but the list contains customer, which have paid mor than 10 and only removed those specific events.

 

Labels (3)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Just reverse the inequality from @PickleRick 's solution

<your search> | eventstats max(price) as custmaxprice by user | where custmaxprice < 10

View solution in original post

rel82wi
Engager

Unfortunately I guess not.

If a customer has an event with purchase >10 I want this customer to be completely filtered out of the result.

Your search I think gives me all maximum prices the customers paid. 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Just reverse the inequality from @PickleRick 's solution

<your search> | eventstats max(price) as custmaxprice by user | where custmaxprice < 10

PickleRick
SplunkTrust
SplunkTrust

Of course. The original post stated "I want a list of customers who never paid more than 10". I can't read 😄

Thx for correcting.

0 Karma

PickleRick
SplunkTrust
SplunkTrust

Use eventstats to be able to filter events based on stats. For example

<your search> | eventstats max(price) as custmaxprice by user | where custmaxprice>10

 Question is - is this what you want 🙂

0 Karma
Get Updates on the Splunk Community!

Enter the Dashboard Challenge and Watch the .conf24 Global Broadcast!

The Splunk Community Dashboard Challenge is still happening, and it's not too late to enter for the week of ...

Join Us at the Builder Bar at .conf24 – Empowering Innovation and Collaboration

What is the Builder Bar? The Builder Bar is more than just a place; it's a hub of creativity, collaboration, ...

Combine Multiline Logs into a Single Event with SOCK - a Guide for Advanced Users

This article is the continuation of the “Combine multiline logs into a single event with SOCK - a step-by-step ...