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!

Laser Bananas and Edge Hubs: Exploring Operational Technology (OT) Data Through a ...

  OT is a different environment to traditional IT and can have interesting challenges when interfacing the ...

Event Series: Mastering AI Tokenomics and Splunk Agent Observability

Beyond the Black Box: Correlating AI Performance and Tokenomics with Splunk Agent Observability   As ...

span_metrics: The OpenTelemetry-Idiomatic Way to See Inside Your Services

You open a trace in Splunk Observability Cloud and everything looks fine. One root span, order-pipeline, with ...