summaryrefslogtreecommitdiffstats
path: root/doc/lookup_tables.html
diff options
context:
space:
mode:
Diffstat (limited to 'doc/lookup_tables.html')
-rw-r--r--doc/lookup_tables.html66
1 files changed, 24 insertions, 42 deletions
diff --git a/doc/lookup_tables.html b/doc/lookup_tables.html
index f8fdbbf6..5aba2568 100644
--- a/doc/lookup_tables.html
+++ b/doc/lookup_tables.html
@@ -33,55 +33,42 @@ is acceptable in order to reload it.
set a local variable to the lookup result and later on use that local variable in templates.
<p>More details on usage now follow.
<h2>Lookup Table File Format</h2>
-<p>Lookup table files consist of a header line and data lines, all inside a plain
-text file.
+<p>Lookup table files contain a single JSON object. This object contains of a header and a
+table part.
<h3>Header</h3>
-<p>The header line is required to be
-<pre>
-LookupTable version="1" nomatch="string"
-</pre>
-<p>Note that case is important, so "lookuptable" would be invalid.
-This is intentional to protect against false positives. The version parameter
+<p>The header is the top-level json. It has paramters "version", "nomatch", and "type".
+The version parameter
must be given and must always be one for this version of rsyslog. The nomatch
parameter is optional. If specified, it contains the value to be used if lookup()
is provided an index value for which no entry exists. The default for
-"nomatch" is the empty string. Note that for version 1,
-parameters must be provided in the order as specified above.
-<h3>Data Lines</h3>
-Each data line must follow this format:
-<pre>
-"index"="value" # comment
-</pre>
-Where "index" and "value" are the actual values to be used. Standard escapes can be used,
-most importantly '\"' represents the double quote characters. Whitespace is ignored, as
-is everything after the comment character.
-<h3>Comment Lines</h3>
-<p>Lines starting with "#" are comments and will be ignored. Leading whitespace before the
-comment character is permitted.
+"nomatch" is the empty string. Type specifies the type of lookup to be done.
+<h3>Table</h3>
+This must be an array of elements, even if only a single value exists (for obvious
+reasons, we do not expect this to occur often). Each array element must contain two
+fields "index" and "value".
<h3>Example</h3>
<p>This is a sample of how an ip-to-office mapping may look like:
<pre>
-LookupTable version="1" nomatch="unk"
-# IP 10.0.1.0/1/2 belong to office A
-"10.0.1.0"="A"
-"10.0.1.1"="A"
-"10.0.1.2"="A"
-# IP 10.0.2.0/1/2 belong to office B
-"10.0.2.0"="B"
-"10.0.2.1"="B"
-"10.0.2.2"="B"
-# if a different IP comes in, the value "unk"
-# is returend thanks to the nomatch parameter in
-# the first line.
+{ "version":1, "nomatch":"unk", "type":"string",
+ "table":[ {"index":"10.0.1.1", "value":"A" },
+ {"index":"10.0.1.2", "value":"A" },
+ {"index":"10.0.1.3", "value":"A" },
+ {"index":"10.0.2.1", "value":"B" },
+ {"index":"10.0.2.2", "value":"B" },
+ {"index":"10.0.2.3", "value":"B" }
+ ]
+}
</pre>
-
+Note: if a different IP comes in, the value "unk"
+is returend thanks to the nomatch parameter in
+the first line.
+<p>
<h2>RainerScript Statements</h2>
<h3>lookup_table() Object</h3>
<p>This statement defines and intially loads a lookup table. Its format is
as follows:
<pre>
-lookup_table(name="name" file="/path/to/file" type="static|dynamic"
- reloadOnHUP="on|off")
+lookup_table(name="name" file="/path/to/file" reloadOnHUP="on|off")
</pre>
<h4>Parameters</h4>
<ul>
@@ -95,11 +82,6 @@ lookup_table(name="name" file="/path/to/file" type="static|dynamic"
must be readable for the user rsyslog is run under (important
when dropping privileges). It must point to a valid lookup
table file as described above.
- <li><b>type</b> (optional, default "dynamic")<br>
- Set the type of this lookup table. Only dynamic tables
- can be reloaded during runtime, but perform a bit
- less well for the same reason (for details see
- intro text).
<li><b>reloadOnHUP</b> (optional, default "on")<br>
Specifies if the table shall automatically be reloaded
as part of HUP processing. For static tables, the
@@ -202,7 +184,7 @@ be sufficiently secured, e.g. via TLS mutual auth.
[<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; 2008-2013 by <a href="http://www.gerhards.net/rainer">Rainer Gerhards</a> and
+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 3 or higher.</font></p>
</body>