[syslog-ng] Check if field in message and use default if not.

Ronald Fenner rfenner at gamecircus.com
Mon Mar 4 23:56:06 UTC 2019

I generate a Kafka topic to send the message to by doing: topic("${topic}.${environment}")
What I'd like to do if the field wasn't in the json message to provide a default value. 

Im looking for like a tertiary operator to use In the topic or perhaps a rewrite rule.

I see the conditional expressions but from the docs it doesn't look like I can use it in the topic or a rewrite rule
NOTE: My messages are json stings that get parsed and then imploded back to json as it's sent.


Ronald Fenner
Network Architect
Game Circus LLC.

rfenner at gamecircus.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.balabit.hu/pipermail/syslog-ng/attachments/20190304/2e89ef21/attachment.html>

More information about the syslog-ng mailing list