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!

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...

Fun with Regular Expression - multiples of nine

Fun with Regular Expression - multiples of nineThis challenge was first posted on Slack #regex channel ...