Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: specify "output channel" and "template" in action #2852

Open
CliveJL opened this issue Jul 18, 2018 · 3 comments
Open

Question: specify "output channel" and "template" in action #2852

CliveJL opened this issue Jul 18, 2018 · 3 comments

Comments

@CliveJL
Copy link

CliveJL commented Jul 18, 2018

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

@rchapin
Copy link

rchapin commented Dec 28, 2020

@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.

@saukrs
Copy link

saukrs commented Dec 2, 2022

Now I am in the search too. My idea was that Output Channels became a legacy and thus aren't being integrated into the RainerScript parser anyway:
https://rsyslog.readthedocs.io/en/latest/configuration/output_channels.html#output-channels

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.

Ping @rgerhards.

@rgerhards
Copy link
Member

Yes, outchannel is only available in legacy config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants