mirror of
https://github.com/rsyslog/rsyslog.git
synced 2025-12-17 07:00:42 +01:00
This enables easy JSON generation via template. This commit also corrects an issue with the constant "jsonf" format. That was recently added, and the implementation problem only became visible when used inside a larger json object. No officially released code is affected, thought - so it rellay is just a side-note. closes https://github.com/rsyslog/rsyslog/issues/2347
19 lines
635 B
Bash
Executable File
19 lines
635 B
Bash
Executable File
#!/bin/bash
|
|
# added 2018-02-10 by Rainer Gerhards; Released under ASL 2.0
|
|
. $srcdir/diag.sh init
|
|
. $srcdir/diag.sh generate-conf
|
|
. $srcdir/diag.sh add-conf '
|
|
template(name="outfmt" type="list" option.jsonf="on") {
|
|
property(outname="message" name="msg" format="jsonf")
|
|
constant(outname="@version" value="1" format="jsonf")
|
|
}
|
|
|
|
local4.* action(type="omfile" file="rsyslog.out.log" template="outfmt")
|
|
'
|
|
. $srcdir/diag.sh startup
|
|
. $srcdir/diag.sh injectmsg 0 1
|
|
. $srcdir/diag.sh shutdown-when-empty
|
|
. $srcdir/diag.sh wait-shutdown
|
|
. $srcdir/diag.sh content-cmp '{"message":" msgnum:00000000:", "@version": "1"}'
|
|
. $srcdir/diag.sh exit
|