Splunk Search

How to search keywords to identify in a field using regex?

sathiyasun
Explorer

How to match keywords to identify in a field using regex.

Our requirement is to capture the keywords that are (Liquor OR Casino OR Gambling OR Adult) which comes in a field.

somesoni2
Revered Legend

Try this. To extract a new field with the keyword and filter events where these keywords are present

index=foo sourcetype=bar (Liquor OR Casino OR Gambling OR Adult) | rex field=_raw "(?<somefield>(Liquor|Casino|Gambling|Adult))"
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 ...