Rsyslog. conf configuration file
This document is currently being enhanced. Please pardon its current appearance.
Rsyslogd is configured via the rsyslog. conf file, Typically found in/etc. By default, rsyslogd reads the file/etc/rsyslog. conf. This may be changed by a command line option.
Configuration File examples can be found in the rsyslog wiki.
There is also one sample file provided together with the documentation set. If you do not like to read, be sure to have at least a quick look at rsyslog-example.conf.
While rsyslogd contains enhancements over standard Syslogd, efforts have been made to keep the configuration file as compatible as possible. while, for obvious reasons, enhanced features require a different Config File Syntax, rsyslogd shoshould be able to work with a standard syslog. CONF file. this is especially useful while you are migrating from syslogd to rsyslogd.
Moduleslines
Lines can be continued by specifying a backslash ("\") as the last character of the line. there is a hard-coded maximum line length of 4 K. if you need lines larger than that, you need to change compile-time settings inside rsyslog and recompile.
Configuration directivesbasic Structure
Rsyslog supports standard sysklogd's configuration file format and extends it. so in general, you can take a "normal" syslog. conf and use it together with rsyslogd. it will understand everything. however, to use most of rsyslogd's unique features, you need to add extended configuration directives.
Rsyslogd supports the classical, selector-based rule lines. they are still at the heart of it and all actions are initiated via rule lines. A rule lines is any line not starting with a $ or the comment sign (#). lines starting with $ carry rsyslog-specific ctives.
Every rule line consists of two fields, a selector field and an action field. these two fields are separated by one or more spaces or tabs. the selector field specifies a pattern of facilities and priorities belonging to the specified action.
Lines starting with a hash mark ("#'') and empty lines are ignored.
Templatesoutput channelsfilter conditionsactionsexamples
Here you will find examples for templates and Selector lines. I hope they are self-explanatory. If not, please see www.monitorware.com/rsyslog/ for advise.
Configuration File Syntax differences
Rsyslogd uses a slightly different syntax for its configuration file than the original BSD sources. originally all messages of a specific priority and above were forwarded to the log file. the modifiers "= '',"! ''And "! -''Were added to make rsyslogd more flexible and to use it in a more intuitive manner.
The original BSD syslogd doesn't understand spaces as separators between the selector and the action field.
When compared to syslogd from sysklogd package, rsyslogd offers additionalfeatures (like template and Database Support). For obvious reasons, the syntax for defining such features is available in rsyslogd, only.
[Back to Top] [manual Index] [rsyslog site]
This documentation is part of the rsyslog project.
Copyright 13.2009 by Rainer gerhards and adiscon. released under the gnu gpl Version 3 or higher.