if one of my fields is host, I want to do
host like "startswith*"
what is the syntax to do that? thanks,
whats the best way to compare with a list of items.
I am looking for something like this:
|search where NotificationEventType in ("THE_CHEESEBURGER%", "THE_HAMBURGER%", "ETC%"...)
@bcherdak : What is the best way to exclude event that start with foo*?
your search | where NOT like(host,"foo%")
This should do the magic.
-- bcherdak, you asked - "What is the best way to exclude event that start with foo*?"
I would say - ... NOT host = "foo*"
While it's probably safe to use NOT host="foo*"
since the host field should always exist, I'd favor the host!="foo*"
syntax; if you have a pattern you're matching on, you probably expect that field to exist in the results. Using the NOT approach will also return events that are missing the field which is probably not what most people want.
Here are are a couple ways.
host=foo*
... | where like(host, "foo%")
thanks! ...
whats the best way to compare with a list of items.
I am looking for something like this:
|search where NotificationEventType in ("THE_CHEESEBURGER%", "THE_HAMBURGER%", "ETC%"...)
What is the best way to exclude event that start with foo*?
If you want to exclude events where a field doesn't start with foo*, use field!="foo*"
.
If you want to exclude events where the event itself doesn't start with foo*, you can use _raw!="foo*"
.