Getting Data In

Inputs hierarchy

fdesterke
New Member

Hello,

I want to monitor a directory but within that directory is another directory which I want to index under a different Source Type.

specifcally:
[monitor:///var/log/*]
sourcetype syslog

and the subfolder
monitor:///var/log/apache2/*
sourcetype apache_error

But the second input falls under the first, and since data isn't indexed twice, I'm wondering how splunk is going to handle this.
Will it just index the apache logs with the first rule with sourcetype syslog. Or is splunk smart enough to index the apache logs with the sourcetype apache_error if i define the second input like that.
Or do I put the apache data input before the other one?
Or do I blacklist the folder in the first input rule, if so, how?

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Use a blacklist within the first stanza to avoid indexing the Apache logs as syslog.

[monitor:///var/log/*]
sourcetype = syslog
# blacklist uses a regular expression, not a pattern
blacklist = (.*apache2.*)

[monitor:///var/log/apache2/*]
sourcetype = apache_error
---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...