How to escape or remove double quotes in rsyslog template

Solution 1:

As of rsyslog 4.6.2, it seems you can just use the json property option:

$template JsonFormat,"{\"msg\":\"%msg:::json%\",\"app-name:::json\":\"%app-name:::json%\"}\n",sql

See here for more details.