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!

Build the Future of Agentic AI: Join the Splunk Agentic Ops Hackathon

AI is changing how teams investigate incidents, detect threats, automate workflows, and build intelligent ...

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...