Rsyslog. conf configuration file syntax

Source: Internet
Author: User
Tags rsyslog
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.