summaryrefslogtreecommitdiff
path: root/doc/rainerscript_call.html
blob: faab5c2433926dd9e55cda1bad78d30ca31292c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<html>
<head>
<title>rsyslog "call" statement</title>
</head>
<body>
<a href="rsyslog_conf_global.html">back</a>

<h1>The rsyslog "call" statement</h1>
<p>The rsyslog "call" statement is used to tie rulesets together.
It is modelled after the usual programming langauge "call" statement. Think
of a ruleset as a subroutine (what it really is!) and you get the picture.

<p>The "call" statement can be used to call into any type of rulesets.
If a rule set has a queue assigned, the message will be posted to that queue
and processed asynchronously. Otherwise, the ruleset will be executed
synchronously and control returns to right after the call when the rule set
has finished execution.

<p>Note that there is an important difference between asynchronous and
synchronous execution in regard to the "stop" statement. It will not affect
processing of the original message when run asynchronously.

<p>The "call" statement replaces the deprecated omruleset module. It offers
all capabilities omruleset has, but works in a much more efficient way.
Note that omruleset was a hack that made calling rulesets possible
within the constraints of the pre-v7 engine. "call" is the clean solution for
the new engine. Especially for rulesets without associated queues (synchronous 
operation), it has zero overhead (really!). omruleset always needs to
duplicate messages, which usually means at least ~250 bytes of memory writes,
some allocs and frees - and even more performance-intense operations.

<h2>syntax</h2>
<p><code>call rulesetname</code></p>
<p>Where "rulesetname" is the name of a ruleset that is defined elsewhere
inside the configration. If the call is synchronous or asynchronous depends
on the ruleset parameters. This cannot be overriden by the "call" statement.

<h2>related links</h2>
<ul>
<li><a href="http://blog.gerhards.net/2012/10/how-to-use-rsyslogs-ruleset-and-call.html">Blog posting announcing "call" statement (with sample)</a>
</ul>

<p>[<a href="rsyslog_conf.html">rsyslog.conf overview</a>] [<a href="manual.html">manual 
index</a>] [<a href="http://www.rsyslog.com/">rsyslog site</a>]</p>
<p><font size="2">This documentation is part of the
<a href="http://www.rsyslog.com/">rsyslog</a> project.<br>
Copyright &copy; 2013 by <a href="http://www.gerhards.net/rainer">Rainer Gerhards</a> and
<a href="http://www.adiscon.com/">Adiscon</a>. Released under the GNU GPL 
version 2 or higher.</font></p>
</body>
</html>