Splunk Search

Search for * in log

mrdaniel
Explorer

I would like to search for a * in my searchresult, more specific i would like to get all entries that is "select *" the problem is that Splunk thinks i would like to use the * as a wildcard.

How can I do to get this to work?

Tags (1)
1 Solution

ziegfried
Influencer

As there is no way to escape the asterisk character, you can do such a search using the regex command:

"select" | regex _raw="(?i)select\s+\*"

This is quite inefficient though. You should try to narrow the search before the regex command as much as you can. ie. specify host(s), source(s), sourcetype(s) etc.

sourectype=sql_log host=dbserver1 "select" | regex ...

View solution in original post

ziegfried
Influencer

As there is no way to escape the asterisk character, you can do such a search using the regex command:

"select" | regex _raw="(?i)select\s+\*"

This is quite inefficient though. You should try to narrow the search before the regex command as much as you can. ie. specify host(s), source(s), sourcetype(s) etc.

sourectype=sql_log host=dbserver1 "select" | regex ...
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Observability Simplified: Combining User Experience, Application Performance & ...

Tech Talk Observability Simplified: Combining User Experience, Application Performance & Network ...

Event Series May & June: From Network Visibility to Service Intelligence

Unifying the Network: Moving from Alert Noise to Service Intelligence with Splunk ITSI In today’s hybrid ...