Splunk Search

How do I not show the value I do not want?

mplungjan
Path Finder

For an apache access log file with an extra field I have created a field extraction myfield - it works great.

I then want to extract all rows where this field is not equal to "-"

So I make a search

myfield !="-" | top limit=10000 myfield

And I still see "-" in the table

alt text

I even tried

myfield !="-" | top limit=10000 myfield | where myfield != "-"

Nope - still there. Since the vast majority of record have "-", all the rest have tiny colums.

What am I doing wrong and where in the documentation does it tell me what I had to do.

It is a bit like the useother=0

Tags (1)
0 Karma
1 Solution

mplungjan
Path Finder

Solved!

The extract included the quotes.

myfield!="\"-\""

works!

View solution in original post

0 Karma

mplungjan
Path Finder

Solved!

The extract included the quotes.

myfield!="\"-\""

works!

0 Karma

mplungjan
Path Finder

No difference. See update

0 Karma

hRun
Path Finder

myfield may contain a blank infront of or after the "-", have you tried myfield!="- ", myfield!=" -" or myfield!="*-*", etc.

0 Karma

gfuente
Motivator

Have you tried this?

search NOT myfield="-" |....

Regards

0 Karma

Ayn
Legend

In that case all your events have a "myfield" with the value "-". Either that, or you're issuing the search incorrectly. Note that you should not be including the actual "search" word if this is the first command in the search pipeline.

0 Karma

mplungjan
Path Finder

No results at all

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...