Skip to content

Commit e09aa61

Browse files
committed
omprog: clarification for binary arguments quoting
With rsyslog/rsyslog#5140 it's possible to use multi-word arguments without quotes getting passed to the program since most option parsers expect all the quotes to be removed by a shell.
1 parent c18296f commit e09aa61

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

source/configuration/modules/omprog.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ binary
8484

8585
"string", "", "yes", "``$ActionOMProgBinary``"
8686

87-
Full path and command line parameters of the external program to execute.
87+
Full path and command line parameters of the external program to execute. The
88+
arguments are split on spaces; if you need to embed a space, add double quotes
89+
to the very beginning and the end of the argument, at all other places the
90+
double quotes symbol is passed as is.
8891

8992
In legacy config, it is **not possible** to specify command line parameters.
9093

@@ -470,14 +473,14 @@ Example: command line arguments
470473

471474
In the following example, logs will be sent to a program ``log.sh`` located
472475
in ``/path/to``. The program will receive the command line arguments
473-
``p1``, ``p2`` and ``--param3="value 3"``.
476+
``p1``, ``p2`` and ``--param3=value 3``.
474477

475478
.. code-block:: none
476479
477480
module(load="omprog")
478481
479482
action(type="omprog"
480-
binary="/path/to/log.sh p1 p2 --param3=\"value 3\""
483+
binary="/path/to/log.sh p1 p2 \"--param3=value 3\""
481484
template="RSYSLOG_TraditionalFileFormat")
482485
483486

0 commit comments

Comments
 (0)