On 06/18/15 19:32, David Lang wrote:
I think it would also up the complexity in some core areas a lot as well.
I don't have a realistic estimate, but I'm afraid it would.
I've worked around this problem with
$template manual,"$.custom\n"
and then used rainerscrpt to do things like
if foo then {
set $.custom = exec_template("a");
} else {
set $.custom = exec_template("b");
}
/var/log/bar;manual
Would this work in a pre-v8? (Not that it would be a blocker if it didn't.)
What the sample above does is close to what I've suggested, but it works
around the limitation that you can't set templates "directly".
I think the key thing is that we want to encapsulate the complexity to
as small an area as possible (both in the code and in what the user
needs to do to use it)
The construct above doesn't come naturally. You have to think about how
to bend the tools get the result.
Things get complicated if you use such a template in multiple outputs
and you want to modify them on different conditions. But that is a
pretty artificial scenario.
I've tried to solve the multi-template problem by using
property-replacer first, but it didn't work out. Maybe shifting more
functionality into or out of templates would help?.. (The regex function
looks like an example of logic not fitting the concept.)
So instead of switching templates or hardcoding special variables, it
could all be handled inside the template..?
Tomas
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
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
THAT.