Getting Data In

How to configure a universal forwarder on a syslog server to monitor logs in this directory structure?

adamblock2
Path Finder

I am interested in configuring a universal forwarder on a syslog server, and have a question regarding how the log data is currently being written.

There are multiple sources which forward log data to the syslog server. Each source is written to a directory structure similar to the following. As the date changes, a new directory is created beneath the logsrc directory.

/logs/logsrc1/2016.05.09
messages
/logs/logsrc1/2016.05.10
messages
/logs/logsrc1/2016.05.11
messages

/logs/logsrc2/2016.05.09
messages
/logs/logsrc2/2016.05.10
messages
/logs/logsrc2/2016.05.11
messages

If each of the log sources is a similar data type, would the following inputs.conf entry correctly forward the data?

[monitor:///logs/]
index=sn_syslog
sourcetype=sn_syslog
recursive=true
0 Karma

mosman_splunk
Splunk Employee
Splunk Employee

you are going to need something like bellow

[monitor:///logs/logsrc*/*.log]
host_segment = 2
sourcetype =locrc
index = test

ignoreOlderThan = 7d

disabled = false

pay attention to line 2 where it take the folder name as host name otherwise it will make everyghing look like it is comming from the syslog server

good luck

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...

Design, Compete, Win: Submit Your Best Splunk Dashboards for a .conf26 Pass

Hello Splunkers,  We’re excited to kick off a Splunk Dashboard contest! We know that dashboards are a primary ...

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...