Splunk Search

How do you incorporate the following regex into a search?

nls7010
Path Finder

How can I get this in a regex that I can use in Splunk?

/[^aA-zZ].[0-9].log

I need to create an alert that looks at /home///log/*** and picks up only what matches the above string.

How can I put that in a search in Splunk?

Tags (2)
0 Karma

michael_schmidt
Path Finder

Try this:

source=/home///log/*| rex field=source "(?P[^aA-zZ].[0-9].log)"

Regardless, the command you need is the rex field=fieldname"regex_goes_here" part to get the regex working within the search.

https://docs.splunk.com/Documentation/Splunk/7.2.3/SearchReference/Rex

0 Karma
Get Updates on the Splunk Community!

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...