Splunk Search

How to exclude a specific value from a column?

rosho
Communicator

Hi

I have a table with 2 columns: "_time" and "isOutlier".
I want to remove all the fields with the value = 1 from the column "isOutlier".
Is there any command?

Thank you

Tags (1)
0 Karma
1 Solution

rosho
Communicator

This is the answer! haha! 🙂

| inputlookup fortigate_QC_May2019_logins.csv
| fit StandardScaler "logins" with_mean=false with_std=true
| fit LocalOutlierFactor "SS_logins" n_neighbors=10 algorithm=auto metric=minkowski p=2 contamination=0.1 leaf_size=30
| where NOT isOutlier==1
| table _time, SS_logins

View solution in original post

0 Karma

rosho
Communicator

This is the answer! haha! 🙂

| inputlookup fortigate_QC_May2019_logins.csv
| fit StandardScaler "logins" with_mean=false with_std=true
| fit LocalOutlierFactor "SS_logins" n_neighbors=10 algorithm=auto metric=minkowski p=2 contamination=0.1 leaf_size=30
| where NOT isOutlier==1
| table _time, SS_logins
0 Karma

adonio
Ultra Champion

try this:
... your search ... | where isOutlier!=1
or this
... your search ... | search isOutlier!=1

hope it helps

0 Karma

rosho
Communicator

But then how I remove the whole row?

This is my SPL:

| inputlookup fortigate_QC_May2019_logins.csv
| fit StandardScaler "logins" with_mean=false with_std=true
| fit LocalOutlierFactor "SS_logins" n_neighbors=10 algorithm=auto metric=minkowski p=2 contamination=0.1 leaf_size=30

| IT IS HERE WHERE I HAVE TO REMOVE THE WHOLE ROW WITH THE OUTLIER

| table _time, isOutlier
0 Karma

kmorris_splunk
Splunk Employee
Splunk Employee

If you just want to filter out the events that are outliers, then you simply have to use isOutlier=0 or isOutlier!=1 in your base search. Unless I am not understanding your goal correctly.

0 Karma

rosho
Communicator

Yes, but then I want to remove the whole row.
So If I have 744 rows with 10 outliers; I will end up with 764 rows.

0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

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