Skip to content
Snippets Groups Projects
Commit daacf00b authored by Thomas Bellman's avatar Thomas Bellman
Browse files

Logserver: Use RainerScript for inputs/outputs.

Use the new-style RainerScript directives for configuring inputs and
outputs in the central logserver config file.
parent faacbec2
No related branches found
No related tags found
No related merge requests found
#########################################################################
# Various global settings
$umask 0022
$WorkDirectory /var/lib/rsyslog
$ModLoad imjournal
$ModLoad imudp
$ModLoad imtcp
$ModLoad imuxsock
$IMJournalStateFile imjournal.state
$UDPServerRun 514
$InputTCPServerRun 514
########################################################################
# Templates for generating log file names
# The regexp-replacement of %FROMHOST% is there to remove ".nsc.liu.se"
......@@ -30,6 +30,10 @@ $template AuditLogfile,"/syslogs/audit/audit-%$YEAR%%$MONTH%%$DAY%-%$HOUR%.log"
########################################################################
# Templates for message formats
# The LogFmtIsoTime template formats logs with ISO timestamps with a
# "T" between the date and time, and always with a microsecond field.
# If the logging host does not provide subsecond resolution, that will
......@@ -61,11 +65,29 @@ $template LogFmtSpaceTime,"%timereported:1:10:date-rfc3339% %timereported:12:19:
$template LogFmtJoinedLog,"%timereported:1:10:date-rfc3339% %timereported:12:19:date-rfc3339%.%timereported:::date-subseconds% %timereported:R,ERE,1,ZERO,0:.*T.*([-+]..:..)--end:date-rfc3339% %FROMHOST:R,ERE,1,FIELD,0:(.*)\.nsc\.liu\.se$--end:secpath-replace%/%HOSTNAME:R,ERE,0,ZERO,0:..*--end:secpath-replace%<%%syslogfacility-text%.%syslogseverity-text%> %syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n"
$umask 0022
$DirCreateMode 0755
$FileCreateMode 0644
$ActionFileDefaultTemplate LogFmtSpaceTime
########################################################################
# Inputs and outputs
module(load="imjournal" StateFile="imjournal.state")
## module(load="imklog") # Kernel messages comes via systemd journal
module(load="imuxsock")
module(load="imudp")
module(load="imtcp")
## input(type="imjournal") # imjournal does not need input()
## input(type="imklog") # imklog does not need input()
input(type="imudp" port="514")
input(type="imtcp" port="514") # syslog port
module(load="builtin:omfile"
# Don't require being root to read log files on syslog server;
# Only trusted people should be allowed to log in.
DirCreateMode="0755"
FileCreateMode="0644"
# And use our formatting of log files
Template="LogFmtSpaceTime")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment