Splunk Search

How to configure REGEX in a props.conf source stanza to match all sources except ones including "/splunk/"?

rainerzufall
Path Finder

Hello,

We would like to match all sources except the ones including /splunk/ in props.conf.

Example: No match for /opt/splunk/var/log/splunk/metrics.log and /opt/splunk/var/log/splunk/splunkd.log

We tried several regex variations, but without luck...

Thanks,
Rainer

0 Karma
1 Solution

johannes88
Engager

I suppose you could try this:
[source::(?!/opt/splunk/var/).../*]

View solution in original post

jplumsdaine22
Influencer

You should have the stanza match the source, not have a regex in the props.conf stanza. So the stanza should be something like [source::/opt/splunk/var/log/splunk/*]

If you want to see more examples have a look at your btool output - $SPLUNK_HOME/splunk cmd btool props list | grep 'source::'

See http://docs.splunk.com/Documentation/Splunk/latest/Admin/Propsconf and search the page for source:: for more details. If you're still having trouble post the relevant props and transforms stanzas here - you might have a different problem than the pattern matching

0 Karma

johannes88
Engager

I suppose you could try this:
[source::(?!/opt/splunk/var/).../*]

rainerzufall
Path Finder

Thanks! That did the trick...

0 Karma

somesoni2
Revered Legend

What are you trying to achieve here? Are you trying to do a field extraction OR event filter OR something else?

0 Karma

rainerzufall
Path Finder

we would like to implement index routing for all events but internal Splunk logs.

0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...