On 3/6/2018 2:53 AM, Rainer Gerhards wrote:
2018-03-06 9:04 GMT+01:00 deoren
On 3/6/2018 1:43 AM, Rainer Gerhards wrote:
2018-03-05 19:17 GMT+01:00 deoren
When refactoring an older configuration I figured I would give global
variables a try.
I'm attempting to create a generic email notification ruleset that can be
called after setting values in a subtree of the $.email-notification
Example (email templates and associated ruleset not included here):
set $/default-email-notification!sender = 'rsyslog-ale...@example.com';
set $/default-email-notification!recipient = 'rsyslog-ad...@example.com';
set $/default-email-notification!subject-template =
set $/default-email-notification!body-template =
set $/default-email-notification!server-ip = '127.0.0.1';
set $/default-email-notification!server-port = '25';
# The parameter is included for every client request, so if we do
# not apply some sort of rate limiting we will be flooded in a
# very short amount of time.
# Note: The interval is configured in number of seconds.
But I think the above will not work, as the parameters must be constant
I ended up learning that the hard way. It's too bad really, as that felt
like a really good place to have support for variables.
For ommail, I would in theory not be such a big problem to support
these things, but in general this would be immensely
performance-hungry. In the concrete case, however, there is no
plumbing at all in the module interface/rsyslog core for this, so it
would probably require weeks of refactoring to make it happen. And for
almost all other cases you really don't want to have that capability,
as it slows down things very, very considerably.
Thanks for explaining. As you've noted, the time investment sounds like
it would be better spent elsewhere.
rsyslog mailing list
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of
sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE