Rsyslog: Difference between revisions

 
(2 intermediate revisions by the same user not shown)
Line 20:
$ModLoad imtcp
$InputTCPServerRun 514
 
At the bottom of the file include the following entry:
{{notice|This section needs to be verified.}}
$template TmplAuth,
"/var/log/%HOSTNAME%/%PROGRAMNAME%.log"
 
Restart rsyslog service
Line 56 ⟶ 51:
$ActionQueueType LinkedList
$ActionResumeRetryCount -1
 
 
*Separate logs for each Host, for each date, Configure like follows.
sudo nano /etc/rsyslog.d/50-default.conf
{{notice|This section needs to be verified.}}
$template Auth_log,"/var/log/auth.d/%fromhost%_%$year%%$month%%$day%.auth"
auth,authpriv.* -?Auth_log
 
 
*Restart rsyslog service
Line 73 ⟶ 60:
logger -p local4.info "This is a info message from local 4"
 
= Generate Syslog messages =
 
*Test UDP syslog messages on port 514 with the following command:
echo "<14>Test UDP syslog message" >> /dev/udp/<target_hostname_or_ip_address>/514
 
*Test TCP syslog messages on port 514 with the following command:
echo "<14>Test TCP syslog message" >> /dev/tcp/<target_hostname_or_ip_address>/514
 
<br />