[rsyslog-notify] Forum Thread: Re: v7.4.9 - Config Help/Complete Documentation - (Mode 'edit_last_post')

noreply at adiscon.com noreply at adiscon.com
Thu Feb 6 20:43:55 CET 2014


User: tonyd 
Forumlink: http://kb.monitorware.com/viewtopic.php?p=24192#p24192

Message: 
----------
Hi dlang,

Thank you for the prompt response!

1) Can you direct me to the documentation/API that outlines ALL of the
variables, syntax, etc for v7+?  I've been unable to locate a "complete"
source.
2) Sample logs, as in from the remote server/router?  I can provide.  I see
them coming from the remote host via tcpdump.
3) There are no confs in the /etc/rsyslog.d/ directory.  Vanilla CentOS6.5
install with the upgrade from rsyslog v5 to v7.4.9 as outlined in my
original post.
4) Odd - I don't disagree with the correction on the variable name, but I
will say infactically, that rsyslogd -f /etc/rsyslog.conf -N1 succeeds. 
Below I cat the current config, stop the service, and validate the config
file.  You'll notice I'm using the "incorrect" $fromip variable.

[code:nkoxwzeo][root at syslog1 log]# cat /etc/rsyslog.conf
# rsyslog configuration file (for Red Hat-based systems)
# note that most of this config file uses old-style format,
# because it is well-known AND quite suitable for simple cases
# like we have with the default config. For more advanced 
# things, RainerScript configuration is suggested.

# For more information see /usr/share/doc/rsyslog-*/rsyslog_conf.html
# If you experience problems, see
http://www.rsyslog.com/doc/troubleshoot.html

#### MODULES ####

module(load="imuxsock") # provides support for local system logging
(e.g. via logger command)
module(load="imklog")   # provides kernel logging support (previously done
by rklogd)
#module(load"immark")  # provides --MARK-- message capability

# Provides UDP syslog reception
# for parameters see http://www.rsyslog.com/doc/imudp.html
module(load="imudp") # needs to be done just once
input(type="imudp" port="514")

# Provides TCP syslog reception
# for parameters see http://www.rsyslog.com/doc/imtcp.html
module(load="imtcp") # needs to be done just once
input(type="imtcp" port="514")

#### GLOBAL DIRECTIVES ####

$umask 0000

#$AllowedSender UDP, 127.0.0.1, 192.168.1.0/24,
192.168.10.0/24, 10.0.0.0/8
#$AllowedSender TCP, 127.0.0.1, 192.168.1.0/24,
192.168.10.0/24, 10.0.0.0/8

# Use default timestamp format
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat

# Reduce any duplicates
$RepeatedMsgReduction on

# File syncing capability is disabled by default. This feature is
usually not required,
# not useful and an extreme performance hit
#$ActionFileEnableSync on

# Include all config files in /etc/rsyslog.d/
$IncludeConfig /etc/rsyslog.d/*.conf

#### TEMPLATES ####

template(name="FileFormat" type="list") {
       property(name="timegenerated" dateFormat="rfc3339")
       constant(value=" ")
       property(name="syslogseverity-text")
       constant(value=" ")
       property(name="hostname")
       constant(value=" ")
       property(name="syslogtag")
       constant(value=" ")
       property(name="msg" spifno1stsp="on" )
       property(name="msg" droplastlf="on" )
       constant(value="\n")
       }

#### FILTERS ####

if ($msg contains '10.0.80.6') then 
   action(type="omfile" file="/var/log/mr1.wilhoit.log"
FileCreateMode="0644")
& stop

if ($fromhost == '216-xx-xx-59.mydomain.net') then 
   action(type="omfile" file="/var/log/vm1.log")
& stop

if ($fromip == '216.xx.x.6') then
   action(type="omfile" file="/var/log/expedienceAAA.log"
FileCreateMode="0644")
& stop

# All other remote logging goes to 'other'
if ( $inputname == 'imudp' or
     $inputname == 'imtcp' ) then
  action(type="omfile" file="/var/log/other.log" FileCreateMode="0644")
& stop

#### RULES ####

# Log all kernel messages to the console.
# Logging much else clutters up the screen.
#kern.*                                                 /dev/console

# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none;cron.none               
/var/log/messages

# The authpriv file has restricted access.
authpriv.*                                              /var/log/secure

# Log all the mail messages in one place.
mail.*                                                 
/var/log/maillog

# Log cron stuff
cron.*                                                  /var/log/cron

# Everybody gets emergency messages
*.emerg                                                
:omusrmsg:*

# Save news errors of level crit and higher in a special file.
uucp,news.crit                                         
/var/log/spooler

# Save boot messages also to boot.log
local7.*                                               
/var/log/boot.log
[root at syslog1 log]#
[root at syslog1 log]# /etc/init.d/rsyslog stop
Shutting down system logger:                               [  OK 
]
[root at syslog1 log]#
[root at syslog1 log]# rsyslogd -f /etc/rsyslog.conf -N1
rsyslogd: version 7.4.9, config validation run (level 1),
master config /etc/rsyslog.conf
rsyslogd: End of config validation run. Bye.
[/code:nkoxwzeo]

I'll add line and restart and see what happens.

Thank you =)


More information about the rsyslog-notify mailing list