The rsyslog is a Syslog logging daemon.


opkg install rsyslog

Route all or specific logs to a (central) rsyslog receiver

With the config file: /etc/rsyslog.conf

*.info;mail.none;authpriv.none;cron.none;kern.none  /var/log/messages
kern.*					  @

If you add to the rsyslog receiver's /etc/rsyslog.conf e.g. this template:

$template DynamicFile,"/mnt/sda1/logs/%HOSTNAME%/forwarded-logs.log"
*.* -?DynamicFile

you get the messages separated from every sender in a own folder.

You can support logging direct to a cloud ELK provider like by adding a few lines to your rsyslog.conf.

Replace codecodecode with your unique identifier, it's 32 characters. And will appear in help manuals when you're logged in, reference the guide here.

$template logzFormatFileTagName,"[codecodecodecode] <%pri%>%protocol-version% %timestamp:::date-rfc3339% %HOSTNAME% %app-name% %procid% %msgid% [type=TYPE] %msg%\n"

Confirm you have the right config with:

rsyslogd -N1
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
  • Last modified: 2024/06/03 07:13
  • by stokito