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 ...
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

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

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...