You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am running rsyslog 8.36.0 on Ubuntu 16.04. I have some legacy config that works quite happily, but I am working on bringing it up-to-date with the newer syntax; losing all the $blah statements.
I've had a deal of success today in migrating to a template that outputs properly formatted JSON (option.jsonf="on") solely using a series of property(outname="field" name="field_value" format="jsonf") etc. Previously this was a mashup of constants and property values including curly braces, commas etc. that sometimes got the JSON right, but very often didn't...
The last part that I would really appreciate some advice on is how to get the following legacy directive into the action(type="foo") format.
My config includes a working template (as mentioned above) called json_lines and an $outchannel definition as follows:
if $syslogtag == 'some_tag' then :omfile:$json_log_rotation;json_lines
I'm struggling to find a working example of an action statement that includes the $outchannel name and also a template name. The legacy one works fine, but I'm on a mission to get rid of the old stuff.
Any help or advice would be appreciated! TIA
The text was updated successfully, but these errors were encountered:
@CliveJL did you ever find a syntax example that works? I've been scouring the Internet as well and the only way I was able to get it to work was with the legacy action as well.
Output Channels are a new concept first introduced in rsyslog 0.9.0. As of this writing, it is most likely that they will be replaced by something different in the future. So if you use them, be prepared to change you configuration file syntax when you upgrade to a later release.
I am running rsyslog 8.36.0 on Ubuntu 16.04. I have some legacy config that works quite happily, but I am working on bringing it up-to-date with the newer syntax; losing all the
$blah
statements.I've had a deal of success today in migrating to a template that outputs properly formatted JSON (option.jsonf="on") solely using a series of
property(outname="field" name="field_value" format="jsonf")
etc. Previously this was a mashup of constants and property values including curly braces, commas etc. that sometimes got the JSON right, but very often didn't...The last part that I would really appreciate some advice on is how to get the following legacy directive into the
action(type="foo")
format.My config includes a working template (as mentioned above) called
json_lines
and an$outchannel
definition as follows:$outchannel json_log_rotation,/opt/rsyslog/some_logfile.log,52428800,/opt/rsyslog/bin/logrotate.sh
The legacy action is as follows:
if $syslogtag == 'some_tag' then :omfile:$json_log_rotation;json_lines
I'm struggling to find a working example of an action statement that includes the
$outchannel
name and also a template name. The legacy one works fine, but I'm on a mission to get rid of the old stuff.Any help or advice would be appreciated! TIA
The text was updated successfully, but these errors were encountered: