Splunk Search

How to use punctuation in a search string: (), [], and *?

lzamora33
New Member

Hi there,

Really basic question but I can't find a detailed answer.
Can someone explain the different uses of (), [], and example in the search app?

Thanks in advance.

0 Karma

rkyadav
Path Finder

example : (warn OR error) NOT fail*

Retrieves all events containing either
“warn” or “error”, but not those that
have “fail”, “fails”, “failed”, failure”,
etc.

example 2 : sourcetype=syslog [search login error | return user]

here, search command, like all commands, can be used as a subsearch—a
search whose results are used as an argument to another search command.
Subsearches are enclosed in square brackets. For example, to find
all syslog events from the user that had the last login error, use the following
command: sourcetype=syslog [search login error | return user]

hope it gives some help to your query

0 Karma

lzamora33
New Member

last question, what happen whit a search between asterisks example source_type = asterisksexampleasterisks

0 Karma

rkyadav
Path Finder

when you search for sourcetype=example , it will fetch all sourcetype which has example as suffix or prefix .

like sourcetypes one_example or example_two will be displayed

0 Karma

lzamora33
New Member

Thanks buddy, that's what i was looking for.

0 Karma

sensitive-thug
Splunk Employee
Splunk Employee

Thank you for asking a question, I'm glad you found a helpful answer from @rkyadav. If their answer solved your issue please accept their answer.

0 Karma
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...