From 8b42f06d338b425f164cb3c534fb2dffe474221c Mon Sep 17 00:00:00 2001 From: Florian Riedl Date: Wed, 17 Apr 2013 09:12:55 +0200 Subject: doc: improve action doc --- doc/rsyslog_conf_actions.html | 118 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 117 insertions(+), 1 deletion(-) diff --git a/doc/rsyslog_conf_actions.html b/doc/rsyslog_conf_actions.html index 0c7705f8..a468a403 100644 --- a/doc/rsyslog_conf_actions.html +++ b/doc/rsyslog_conf_actions.html @@ -3,6 +3,123 @@

This is a part of the rsyslog.conf documentation.

back +

Actions

+The action describes what to do with a log message. In general, +message content is written to a kind of "logfile". +But also other actions might be done, like writing to a database +table or forwarding to another host.
+
+There is a certain base format to configure a action that needs to follow +either a selector or a filter. If no selector or filter is configured +before the action line begins, all messages will be used automatically.
+
+A action line could look like this

+

*.auth action(type="omfwd" file="/var/log/auth")

+

Or a little simpler

+

action(type="omfwd" file="/var/log/auth")

+

without a selector, which will execute the action for all messages. +The command to initiate a action is always action(). +In the brackets you determine the parameters for the action, like type, +destination or special processing parameters. There are two types of action +parameters. The first are the general action parameters described below. +The second type are the module instance parameters. They are described in +the documentation of the respective module.

+

General Action Parameters

+ +

Action Queues

+

For some types of action it would make sense to have a queue ready which +will "store" log messages on a interim basis to prevent message loss. This +commonly applies to the forwarding kind of actions. Here is a list of Parameters +that are used for a action queue. Queues are described in the respective article.

+ +

Multiple Actions

+

You can have multiple actions for a single selector (or more precisely +a single filter of such a selector line). Each action must be called with +it's own action() statement and must all be enclosed by square brackets. +An example would be

+

*.=crit[ +
action(type="omfwd" target="10.10.10.1" port="514" transport="udp") +
action(type="omusrmsg" user="rger") +
action(type="omfile" file="/var/log/critmsgs") +
]

+

These three lines send critical messages to a host via UDP, the user rger +and also store them in /var/log/critmsgs. Using multiple actions per selector +is convenient and also offers a performance benefit. As the filter needs to +be evaluated only once, there is less computation required to process +the directive

+

Stop/Discard

+

The stop action is no real action. It is basically a trigger to stop +processing of the message. Though, it is basically used instead of action() +in a selector line. For obvious reasons, the result of "stop" is depending +on where in the configuration it is used. Please note, that once processing +of a message has been stopped, there is no way to retrieve it in later +configuration file lines.
+
+Stop can be highly effective if you want to filter out some annoying +messages that otherwise would fill your log files. To do that, place the +discard actions early in your log files. This often plays well with +property-based filters, giving you great freedom in specifying what you +do not want.
+
+It can be used like this:

+

Stop

+

Here, processing for all messages will be stopped and the messages will +be discarded. Though, using it this way is obviously stupid, especially at +the beginning of the configuration.

+

Actions (legacy format)

The action field of a rule describes what to do with the message. In general, message content is written to a kind of "logfile". @@ -331,7 +448,6 @@ one template name for each given action. The default template is specific to each action. For a description of what a template is and what you can do with it, see "TEMPLATES" at the top of this document.

-

[manual index] [rsyslog.conf] [rsyslog site]

-- cgit v1.2.3 From 1f3b2e2c74dad8ac0eb554372e4128b65ae8e772 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 17 Apr 2013 09:42:05 +0200 Subject: doc: further improve action doc --- doc/rsyslog_conf_actions.html | 167 +++++++++++++++--------------------------- 1 file changed, 60 insertions(+), 107 deletions(-) diff --git a/doc/rsyslog_conf_actions.html b/doc/rsyslog_conf_actions.html index a468a403..fa240d97 100644 --- a/doc/rsyslog_conf_actions.html +++ b/doc/rsyslog_conf_actions.html @@ -4,129 +4,82 @@

This is a part of the rsyslog.conf documentation.

back

Actions

-The action describes what to do with a log message. In general, -message content is written to a kind of "logfile". -But also other actions might be done, like writing to a database -table or forwarding to another host.
-
-There is a certain base format to configure a action that needs to follow -either a selector or a filter. If no selector or filter is configured -before the action line begins, all messages will be used automatically.
-
-A action line could look like this

-

*.auth action(type="omfwd" file="/var/log/auth")

-

Or a little simpler

-

action(type="omfwd" file="/var/log/auth")

-

without a selector, which will execute the action for all messages. -The command to initiate a action is always action(). -In the brackets you determine the parameters for the action, like type, -destination or special processing parameters. There are two types of action -parameters. The first are the general action parameters described below. -The second type are the module instance parameters. They are described in -the documentation of the respective module.

+Action object describe what is to be done with a message. They are +implemented via outpout modules. +

The action object has different parameters: +

General Action Parameters

-

Action Queues

-

For some types of action it would make sense to have a queue ready which -will "store" log messages on a interim basis to prevent message loss. This -commonly applies to the forwarding kind of actions. Here is a list of Parameters -that are used for a action queue. Queues are described in the respective article.

- -

Multiple Actions

-

You can have multiple actions for a single selector (or more precisely -a single filter of such a selector line). Each action must be called with -it's own action() statement and must all be enclosed by square brackets. -An example would be

-

*.=crit[ -
action(type="omfwd" target="10.10.10.1" port="514" transport="udp") -
action(type="omusrmsg" user="rger") -
action(type="omfile" file="/var/log/critmsgs") -
]

-

These three lines send critical messages to a host via UDP, the user rger -and also store them in /var/log/critmsgs. Using multiple actions per selector -is convenient and also offers a performance benefit. As the filter needs to -be evaluated only once, there is less computation required to process -the directive

-

Stop/Discard

-

The stop action is no real action. It is basically a trigger to stop -processing of the message. Though, it is basically used instead of action() -in a selector line. For obvious reasons, the result of "stop" is depending -on where in the configuration it is used. Please note, that once processing -of a message has been stopped, there is no way to retrieve it in later -configuration file lines.
-
-Stop can be highly effective if you want to filter out some annoying -messages that otherwise would fill your log files. To do that, place the -discard actions early in your log files. This often plays well with -property-based filters, giving you great freedom in specifying what you -do not want.
-
-It can be used like this:

-

Stop

-

Here, processing for all messages will be stopped and the messages will -be discarded. Though, using it this way is obviously stupid, especially at -the beginning of the configuration.

-

Actions (legacy format)

-

The action field of a rule describes what to do with the -message. In general, message content is written to a kind of "logfile". -But also other actions might be done, like writing to a database table -or forwarding to another host.
-
-Templates can be used with all actions. If used, the specified template + +

Legacy Format

+

Be warned that legacy action format is hard to get right. It is +recommended to use RainerScript-Style action format whenever possible! +A key problem with legacy format is that a single action is defined via +multiple configurations lines, which may be spread all across rsyslog.conf. +Even the definition of multiple actions may be intermixed (often not +intentional!). If legacy actions format needs to be used (e.g. some modules +may not yet implement the RainerScript format), it is strongly recommended +to place all configuration statements pertaining to a single action +closely together. +

Please also note that legacy action parameters do not affect +RainerScript action objects. So if you define for example: + +

+$actionResumeRetryCount 10
+action(type="omfwd" target="server1.example.net")
+@@server2.example.net
+
+ +server1's "action.resumeRetryCount" parameter is not set, instead +server2's is! +

A goal of the new RainerScript action format was to avoid confusion +which parameters are actually used. As such, it would be counter-productive +to honor legacy action parameters inside a RainerScript definition. As +result, both types of action definitions are strictly (and nicely) +separated from each other. The bottom line is that if RainerScript actions +are used, one does not need to care about which legacy action parameters may +(still...) be in effect. +

+

Note that not all modules necessarily support legacy action format. +Especially newer modules are recommended to NOT support it. +

Legacy Description

+

Templates can be used with many actions. If used, the specified template is used to generate the message content (instead of the default template). To specify a template, write a semicolon after the action value immediately followed by the template name.
@@ -453,7 +406,7 @@ what you can do with it, see "TEMPLATES" at the top of this document.

[rsyslog site]

This documentation is part of the rsyslog project.
-Copyright © 2008-2011 by Rainer Gerhards and +Copyright © 2008-2013 by Rainer Gerhards and Adiscon. Released under the GNU GPL version 2 or higher.

-- cgit v1.2.3