File: rs-exists.rst

package info (click to toggle)
rsyslog-doc 8.2302.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,464 kB
  • sloc: python: 178; makefile: 8
file content (30 lines) | stat: -rw-r--r-- 662 bytes parent folder | download | duplicates (2)
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
********
exists()
********

Purpose
=======

exists($!path!varname)

This function checks if the specified variable exists, in other
words: contains a value. A variable that once was set and later
on unset does also not exist.

The function accepts a single argument, which needs to be a variable.
It returns 0 if the variable does not exist and 1 otherwise. The
function can be combined with any other expression to form more
complec expressions.

.. versionadded:: 8.2010.10


Example
=======

.. code-block:: none

   if exists(!$path!varname) then ...
   if not exists($.local!var) then ...
   if exists($!triggervar) and $msg contains "something" then ...