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 Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk on November 6 at 11AM PT, and empower your SOC to reach new heights! Duration: ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...