Skip to content

Rsyslog dynamic file name

Хотим писать на сервере логи свичей из локалки.

Делаем так:

$template Dynamic,"/var/log/net/%HOSTNAME%/sw.log"
if $source contains '10.20.0' then ?Dynamic
if $source contains '10.20.0' then ~

service restart rsyslog

Вуаля :)

Leave a Reply

Your email address will not be published. Required fields are marked *

π