FastHandle - IT Operations Examples

FastHandle is fast operation tools for infrastructure configurations and tests.

User Tools

Site Tools


middleware:rsyslog:syslog-server.html



Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
middleware:rsyslog:syslog-server.html [2018/01/28 01:24]
kurihara
middleware:rsyslog:syslog-server.html [2018/04/19 00:00]
kurihara
Line 10: Line 10:
  
 <sxh bash toolbar:false gutter:false> <sxh bash toolbar:false gutter:false>
 +#=============================================================
 #### MODULES #### #### MODULES ####
 +#=============================================================
 $ModLoad imuxsock # provides support for local system logging (e.g. via logger command) $ModLoad imuxsock # provides support for local system logging (e.g. via logger command)
 $ModLoad imjournal # provides access to the systemd journal $ModLoad imjournal # provides access to the systemd journal
  
 +## Syslog Serfer
 +# Provides UDP syslog reception
 +$ModLoad imudp
 +$UDPServerRun 514
 +
 +# Provides TCP syslog reception
 +$ModLoad imtcp
 +$InputTCPServerRun 514
 +
 +#=============================================================
 #### GLOBAL DIRECTIVES #### #### GLOBAL DIRECTIVES ####
 +#=============================================================
 $WorkDirectory /var/lib/rsyslog $WorkDirectory /var/lib/rsyslog
 $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
Line 23: Line 35:
 $IMJournalStateFile imjournal.state $IMJournalStateFile imjournal.state
  
 +# Syslog Server
 +$umask 0022
 +$FileCreateMode 0644
 +$DirCreateMode 0755
 +
 +#=============================================================
 #### RULES #### #### RULES ####
 +# Rules are applied sequentially from the top
 +#=============================================================
 +# Syslog Server Rule
 +$template RemoteHost, "/var/log/rsyslog/%$year%/%$month%/%$day%/%hostname%.%$year%%$month%%$day%.log"
 +:fromhost-ip, !isequal, "127.0.0.1" -?RemoteHost
 +& ~
 +
 +# Default Rule
 *.info;mail.none;authpriv.none;cron.none                /var/log/messages *.info;mail.none;authpriv.none;cron.none                /var/log/messages
 authpriv.*                                              /var/log/secure authpriv.*                                              /var/log/secure
Line 32: Line 58:
 local7.*                                                /var/log/boot.log local7.*                                                /var/log/boot.log
  
-#=========================================== 
-# Syslog Server 
-#=========================================== 
-# Provides UDP syslog reception 
-$ModLoad imudp 
-$UDPServerRun 514 
  
-Provides TCP syslog reception +Max messages is 10000 messages in 30 seconds 
-$ModLoad imtcp +$imjournalRatelimitInterval 30 
-$InputTCPServerRun 514+$imjournalRatelimitBurst 10000 
 +</sxh>
  
-$umask 0022 
-$FileCreateMode 0644 
-$DirCreateMode 0755 
  
-$template logrotate, "/var/log/rsyslog/%hostname%/%$year%/%$month%/%hostname%.%$day%.log"+\\ 
 +\\ 
 +===== Note ===== 
 +==== Template ====
  
-:fromhost-ip, !isequal, "127.0.0.1" -?logFileName+<sxh bash toolbar:false gutter:false> 
 +# Template name is RemoteHost 
 +$template RemoteHost, "/var/log/rsyslog/%hostname%/%hostname%.%$year%%$month%%$day%.log" 
 +:fromhost-ip, !isequal, "127.0.0.1" -?RemoteHost
 & ~ & ~
 </sxh> </sxh>
  
-===== Note ===== 
 <sxh bash toolbar:false gutter:false> <sxh bash toolbar:false gutter:false>
-$template logFileName, "/var/log/rsyslog/%$year%/%$month%/%$day%/%fromhost%_%$year%%$month%%$day%.log"+# Template name is RemoteHost 
 +$template RemoteHost, "/var/log/rsyslog/%hostname%/%$year%/%$month%/%hostname%.%$day%.log" 
 +:fromhost-ip, !isequal, "127.0.0.1" -?RemoteHost 
 +& ~
 </sxh> </sxh>
 +
 +<sxh bash toolbar:false gutter:false>
 +# Template name is RemoteHost
 +$template RemoteHost, "/var/log/rsyslog/%$year%/%$month%/%$day%/%fromhost%_%$year%%$month%%$day%.log"
 +:fromhost-ip, !isequal, "127.0.0.1" -?RemoteHost
 +& ~
 +</sxh>
 +
 +
 +\\
 +==== AllowedSender====
  
 <sxh bash toolbar:false gutter:false> <sxh bash toolbar:false gutter:false>
Line 68: Line 105:
 </sxh> </sxh>
  
 +\\
 +<WRAP box 90%>
 +<catlist -noAddPageButton -smallHead -sortAscending>
 +</WRAP>
  
 \\ \\
 \\ \\
 [[middleware:rsyslog:index.html|]] [[middleware:rsyslog:index.html|]]


middleware/rsyslog/syslog-server.html.txt · Last modified: 2018/04/19 00:11 by kurihara