Skip to content

Commit

Permalink
omprog: clarification for binary arguments quoting
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
paulfertser committed May 22, 2023
1 parent c18296f commit e09aa61
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions source/configuration/modules/omprog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ binary

"string", "", "yes", "``$ActionOMProgBinary``"

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

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

Expand Down Expand Up @@ -470,14 +473,14 @@ Example: command line arguments

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

.. code-block:: none
module(load="omprog")
action(type="omprog"
binary="/path/to/log.sh p1 p2 --param3=\"value 3\""
binary="/path/to/log.sh p1 p2 \"--param3=value 3\""
template="RSYSLOG_TraditionalFileFormat")
Expand Down

0 comments on commit e09aa61

Please sign in to comment.