Resolves #788 adding rsyslog example for CentOS journal.

This commit is contained in:
Stein Arne Storslett
2022-08-30 12:01:20 +02:00
parent ef133608bb
commit 020d6a0ceb

View File

@@ -1,17 +1,45 @@
# use old-style syntax for rsyslog, since it will work everywhere
#
# Configuration options for rsyslog / log handling
#
# Default to old-style Property-Based Filters syntax for rsyslog
:programname,isequal,"weewx" /var/log/weewx.log
:programname,isequal,"weewx" stop
:programname,startswith,"wee_" /var/log/weewx.log
:programname,startswith,"wee_" stop
# this is the old syntax (pre v6, still supported post v6)
##
## EXAMPLE 1:
## Rsyslog 'RainerScript' full syntax with multiple conditions
## 'RainerScript' has replaced the BSD syntax, but both are supported.
## Basic if...else support since v5, fully supported since v6
##
#if ($programname == "weewx" or $programname startswith "wee_") then {
# /var/log/weewx.log
# stop
#}
## Handle weewx utils in RHEL / Centos where logs are written through journal
#if ($programname == "journal" and $msg contains 'wee_') then {
# /var/log/weewx.log
# stop
#}
#
# EXAMPLE 2:
# A more basic 'RainerScript' syntax
#
#if $programname == 'weewx' then /var/log/weewx.log
#if $programname == 'weewx' then stop
#if $programname startswith 'wee_' then /var/log/weewx.log
#if $programname startswith 'wee_' then stop
## Handle weewx utils in RHEL / Centos where logs are written through journal
#if $programname == 'journal' and $msg startswith 'wee_' then /var/log/weewx.log
#if $programname == 'journal' and $msg startswith 'wee_' then stop
#
# EXAMPLE 3 - deprecated:
# The tilde "~" discard action is deprecated, but supported, since v6
#
#:programname,isequal,"weewx" /var/log/weewx.log
#:programname,isequal,"weewx" ~
#:programname,startswith,"wee_" /var/log/weewx.log
#:programname,startswith,"wee_" ~
# this is the new 'RainerScript' syntax (if...else since v5, fully since v6)
#if $programname == 'weewx' then /var/log/weewx.log
#if $programname == 'weewx' then ~
#if $programname startswith 'wee_' then /var/log/weewx.log
#if $programname startswith 'wee_' then ~