My existing syslog-ng PE 5 (yes, old) server uses multiple log statements to both write all logs locally, and also to relay some messages to external log scanning services in our enterprise.
The operator of one of these external relay destinations has requested we truncate each log message relayed to them down to a specific maximum length.
I don't want to reduce the global value for message length. I only want to limit the size sent to this one destination.
I assume this will be a switch or flag in a log statement. I've looked at the docs for rewriting rules and see nothing obvious.
How have you solved this issue?
while it's not as simple as setting a flag, I can think of 3-4 possible solutions. Not all of them work with PE 5 though.
If you are willing to upgrade:
If you want to stick to old versions:
Personally, I'd recommend some kind of upgrade (PE 5 is ancient and EOL). If you cannot upgrade to a recent PE version, the easiest solution might be to install an OSE relay, so your PE 5 server send the logs to OSE, which can use the substr() template function to truncate the messages and send them over to your log scanner.
HTH, Robert