[systemd-devel] Q: logger: "invalid structured data parameter: 'fo\o="b\"a\"r"'"

Ulrich Windl Ulrich.Windl at rz.uni-regensburg.de
Mon May 2 08:40:29 UTC 2022


Hi!

If I understand it corrctly the logger from
util-linux-systemd-2.33.2-4.18.1.x86_64 of SLES12 is part of systemd; if not,
then please ignore.

I'm testing my implementation of RFC5424 syslog daemon, and I tried this
command:

logger -d --id --msgid=test1 -n 127.0.0.1 --port 10514 \
--rfc5424 --sd-id=test1-id at 32473 --sd-param 'fo\o="b\"a\"r"' \
--sd-param 'jack="jill"' -t test-tag -p user.notice "${1:-test message}"

While --sd-param 'fo\o="bar"' worked, --sd-param 'fo\o="b\"a\"r"' does not.
Instead I get the message:
logger: invalid structured data parameter: 'fo\o="b\"a\"r"'

RFC 5424 states on page 16 (6.3.3 SD-PARAM):
   Inside PARAM-VALUE, the characters ’"’ (ABNF %d34), ’\’ (ABNF %d92),
   and ’]’ (ABNF %d93) MUST be escaped.  This is necessary to avoid
   parsing errors.

So my interpretation is that when " must be escaped, it's allowed to use \".

Am I wrong?

Regards,
Ulrich




More information about the systemd-devel mailing list