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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...