Getting Data In

monitoring a directory and setting sourcetypes

andywt123
New Member

I have a universal forwarder monitoring /var/log directory on our syslog server. In the directory I have files of aaa,bbb,ccc, plus other files. What is the best way to monitor these files and set different source types. I want to set a different sourcetype for those three files and then everything else would be sourcetype=syslog. Would the following work?

[monitor:///var/logs]
blacklist = aaa|bbb
sourcetype=syslognew

[monitor:///var/logs]
blacklist = aaa|ccc
sourcetype=syslogvmware

[monitor:///var/logs]
blacklist = ccc|bbb
sourcetype=syslogaaa

[monitor:///var/logs]
blacklist = aa|bbb|ccc
sourcetype=syslog

Tags (3)
0 Karma

andywt123
New Member

Thanks for the answer, How would you configure the source statement to get everything starting with aaa? would [source::aaa*] work?

0 Karma

andywt123
New Member

Thanks for the answer, How would you configure the source statement to get everything starting with aaa? would [source::aaa*] work?

0 Karma

lguinn2
Legend

I would NOT recommend this method. Each monitor stanza should be unique. Do this instead

inputs.conf

[monitor:///var/log]

props.conf (in the same directory)

[source::aaa]
sourcetpe=syslogaaa

[source::bbb]
sourcetype= syslogvmware

etc.

Note that you are using Splunk's automatic sourcetyping in inputs.conf. Then you can use props.conf to set sourcetypes for individual inputs - if needed.

0 Karma

andywt123
New Member

Thanks for the answer, How would you configure the source statement to get everything starting with aaa? would [source::aaa*] work?

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Introduction to Splunk AI

How are you using AI in Splunk? Whether you see AI as a threat or opportunity, AI is here to stay. Lucky for ...

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...

Maximizing the Value of Splunk ES 8.x

Splunk Enterprise Security (ES) continues to be a leader in the Gartner Magic Quadrant, reflecting its pivotal ...