Getting Data In

Consolidating two [monitor://] stanzas

_smp_
Builder

I'm dealing with a set of web servers with an inconsistent access logging configuration. There is some variability in the path and the name of the files:
Source

/usr/local2/searchapps/v-ESP_ssl/logs/access.log
/usr/local2/searchapps/v-admin11/conf/ssl/logs/access_log
/usr/local2/searchapps/v-admin11/logs/access.log

There are additional file patterns in these same directory paths that I don't want to index:

<PATH>/access.log-2020-06-13-1592036161
<PATH>/access.log-2020-06-13-1592036161.gz

It seems I can pull everything in correctly with two [monitor] stanzas:

[monitor:///usr/local2/searchapps/v-*/.../logs/access*]
index           = web
sourcetype      = access_combined
crcSalt         = <SOURCE>
whitelist       = access[\._]log$

[monitor:///usr/local2/searchapps/v-*/logs/access*]
index           = web
sourcetype      = access_combined
crcSalt         = <SOURCE>
whitelist       = access[\._]log$


For my own education, I'm trying to simplify the configuration by collapsing them into a single stanza and getting rid of the whitelist. So far I've been unsuccessful, it seems mostly due to the behavior of the ... and * wildcards.

Is there a way to combine those two inputs into one and further simplify?

Labels (2)
0 Karma

richgalloway
SplunkTrust
SplunkTrust
I don't see an easy way. Even if you were to come up with one, could you or your successor maintain it? What if another filepath had to be added? Keeping it simple does just mean fewer characters in the .conf file.
---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

🔐 Trust at Every Hop: How mTLS in Splunk Enterprise 10.0 Makes Security Simpler

From Idea to Implementation: Why Splunk Built mTLS into Splunk Enterprise 10.0  mTLS wasn’t just a checkbox ...

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

Splunk Decoded: Business Transactions vs Business IQ

It’s the morning of Black Friday, and your e-commerce site is handling 10x normal traffic. Orders are flowing, ...