Getting Data In

How many wild cards (*) can I put in monitoring path?

melonman
Motivator

Hi

I have configured the monitor path of inputs.conf.

/nfsmount/log/log.d*_vd*hoge*/*/*/aaa_*_bb*-ccc*.log

My question is how many wildcard characters I can put in the path.
Is there any limitation of use of wildcard in monitor path?

I have checked the following articles, but still can not find the answer...

http://splunk-base.splunk.com/answers/13613/use-of-wild-card-character-in-monitor-path
http://www.splunk.com/base/Documentation/latest/Data/Specifyinputpathswithwildcards

Any thought?

Thank you in advance!

Tags (1)
1 Solution

dwaddle
SplunkTrust
SplunkTrust

I don't think there is a practical limit. Unless this has changed in newer versions, Splunk implements wildcards in the monitor stanza using whitelist and blacklist under the covers. So, your rule of

[monitor:///nfsmount/log/log.d*_vd*hoge*/*/*/aaa_*_bb*-ccc*.log]

Translates underneath to something like:

[monitor:///nfsmount/log]
whitelist=^/nfsmount/log/log\.d[^/]*_vd[^/]*hoge/[^/]*/[^/]*/aaa_[^/]*_bb_[^/]*-ccc[^/]*\.log$

NOTE: The regex above may not be exactly how Splunk handles this internally, but is meant to be representative of how Splunk might implement it. And I might have just gotten the regex wrong :).

On the one hand, you can implement this yourself (perhaps more easily) using whitelist/blacklist. But, on the other, I am concerned that either way you implement this it will deeply recurse through /nfsmount/log, which may not perform very well, depending on how many files exist in this tree.

View solution in original post

dwaddle
SplunkTrust
SplunkTrust

I don't think there is a practical limit. Unless this has changed in newer versions, Splunk implements wildcards in the monitor stanza using whitelist and blacklist under the covers. So, your rule of

[monitor:///nfsmount/log/log.d*_vd*hoge*/*/*/aaa_*_bb*-ccc*.log]

Translates underneath to something like:

[monitor:///nfsmount/log]
whitelist=^/nfsmount/log/log\.d[^/]*_vd[^/]*hoge/[^/]*/[^/]*/aaa_[^/]*_bb_[^/]*-ccc[^/]*\.log$

NOTE: The regex above may not be exactly how Splunk handles this internally, but is meant to be representative of how Splunk might implement it. And I might have just gotten the regex wrong :).

On the one hand, you can implement this yourself (perhaps more easily) using whitelist/blacklist. But, on the other, I am concerned that either way you implement this it will deeply recurse through /nfsmount/log, which may not perform very well, depending on how many files exist in this tree.

melonman
Motivator

Thans, dwaddle!

0 Karma

tskinnerivsec
Contributor

Does this example monitor stanza work? I'm trying to do something very similar:
[monitor:///var/log/syslog/sw]

and this didn't pull in any data.

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...