A
A
Alexey2020-12-09 19:13:06
RSYSLOG
Alexey, 2020-12-09 19:13:06

How to collect logs from multiple files using rsyslog?

There are several log files on the server - app1.log, app2.log ...
I want to collect them into one file using rsyslog, with the aim of sending them to a remote server for collecting and analyzing logs in the future.

I do so.

/etc/rsyslog.conf

module(load="imfile")

input(type="imfile"
      File="/apps/app1.log"
      Facility="local7"
      Severity="notice")

input(type="imfile"
      File="/apps/app2.log"
      Facility="local7"
      Severity="notice")


/etc/rsyslog.d/50-default.conf
local7.notice -/var/log/apps.log

I do service rsyslog restart
The file /var/log/apps.log is not even created. Logs are not collected.
What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question