I have systems running syslog and rsyslog across my environment and I would like to have similar outputs.

I have created a template in rsyslog that looks like the following:

$template TraditionalFormatWithPRI,"%TIMESTAMP:::date-rfc3339% %HOSTNAME% %pri-text%:%syslogtag%%msg:::drop-last-lf%\n"

I would like to create something similar in syslog-ng but I cannot seem to find a replacement for %pri-text% which outputs the source of the message and the log level. Does anyone know if there is an equivalent in syslog-ng or if there is a combination of two template functions that I can use to create the same output?

thanks in advance!


I believe you need the ${PRIORITY} or the ${LEVEL} macros, see https://www.balabit.com/documents/syslog-ng-ose-latest-guides/en/syslog-ng-ose-guide-admin/html/reference-macros.html

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.