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!

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...

Announcing the Migration of the Splunk Add-on for Microsoft Azure Inputs to ...

Announcing the Migration of the Splunk Add-on for Microsoft Azure Inputs to Officially Supported Splunk ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI! Discover how Splunk’s agentic AI ...