Getting Data In

Does props.conf support wildcards?

daniel333
Builder

All,

I found myself writing this props.conf today.

Say I have this:

[tomcat:src:server]
EXTRACT-springapp_name = /var/log/containerlogs/(?.+)/\d in source
EXTRACT-containerid = /var/log/containerlogs/.+/(?.+)/ in source

[tomcat:src:access]
EXTRACT-springapp_name = /var/log/containerlogs/(?.+)/\d in source
EXTRACT-containerid = /var/log/containerlogs/.+/(?.+)/ in source

I could I just do this?

[tomcat:src:*]
EXTRACT-springapp_name = /var/log/containerlogs/(?.+)/\d in source
EXTRACT-containerid = /var/log/containerlogs/.+/(?.+)/ in source
0 Karma

the_wolverine
Champion

I have seen wildcards in source are buggy and don't work as expected. File bugs.

somesoni2
Revered Legend

I believe the stanza for sourcetype doesn't support wild-card/regular expression. The stanza for host:: and source:: do.

http://docs.splunk.com/Documentation/Splunk/6.4.2/Admin/Propsconf

[<spec>]
<spec> can be:
1. <sourcetype>, the source type of an event.
2. host::<host>, where <host> is the host, or host-matching pattern, for an
                 event.
3. source::<source>, where <source> is the source, or source-matching
                     pattern, for an event.

dshpritz
SplunkTrust
SplunkTrust

Not officially. Should it? Yes! But no, it does not.

An unofficial/unsupported/could break in the future solution is this:
http://blogs.splunk.com/2014/07/31/quick-tip-wildcard-sourcetypes-in-props-conf/

So you would use something like:

[(?::){0}tomcat:src:*]

Again, this is an undocumented way of doing this, so Splunk could take that away at any point, so keep that in mind.

Dave

Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...