Mailing List Archive

How can a config-let know what RuleSet is currently active?
Hi folks,

New to the ML.
I have a config file part (pulled from .../rsyslog.d/) which, due to the structure of the config process, *might* be pulled in in different parts of the config file.

It would be really helpful if I could figure out the currently active RuleSet when my config code runs. I was looking for $RuleSet as a property I can query, but that's not available.

Any other way to do that?

Thanks in advance for any insight.

_____________________________________
Sent from http://rsyslog-users.1305293.n2.nabble.com

_______________________________________________
rsyslog mailing list
https://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.
Re: How can a config-let know what RuleSet is currently active? [ In reply to ]
Hi folks - any thoughts re this?

I have read the correspondence re "ruleset as a variable". Could not solve
my case: my included file might be pulled into the main config file in
different locations / sections, under different (legacy syntax) $RuleSet
directives. I can't seem to find a good way to have my message filters be
included, but always leave the "current" ruleset in effect.

Thanks!



rsyslog-users mailing list wrote
> Hi folks,
>
> New to the ML.
> I have a config file part (pulled from .../rsyslog.d/) which, due to the
> structure of the config process, *might* be pulled in in different parts
> of the config file.
>
> It would be really helpful if I could figure out the currently active
> RuleSet when my config code runs. I was looking for $RuleSet as a property
> I can query, but that's not available.
>
> Any other way to do that?
>
> Thanks in advance for any insight.





--
Sent from: http://rsyslog-users.1305293.n2.nabble.com/
_______________________________________________
rsyslog mailing list
https://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.
Re: How can a config-let know what RuleSet is currently active? [ In reply to ]
maybe doing a

set $.rulesetname = "nameOfRuleset";

right after the $ruleset directive?

Rainer

El mar., 20 oct. 2020 a las 14:12, doron via rsyslog
(<rsyslog@lists.adiscon.com>) escribió:
>
> Hi folks - any thoughts re this?
>
> I have read the correspondence re "ruleset as a variable". Could not solve
> my case: my included file might be pulled into the main config file in
> different locations / sections, under different (legacy syntax) $RuleSet
> directives. I can't seem to find a good way to have my message filters be
> included, but always leave the "current" ruleset in effect.
>
> Thanks!
>
>
>
> rsyslog-users mailing list wrote
> > Hi folks,
> >
> > New to the ML.
> > I have a config file part (pulled from .../rsyslog.d/) which, due to the
> > structure of the config process, *might* be pulled in in different parts
> > of the config file.
> >
> > It would be really helpful if I could figure out the currently active
> > RuleSet when my config code runs. I was looking for $RuleSet as a property
> > I can query, but that's not available.
> >
> > Any other way to do that?
> >
> > Thanks in advance for any insight.
>
>
>
>
>
> --
> Sent from: http://rsyslog-users.1305293.n2.nabble.com/
> _______________________________________________
> rsyslog mailing list
> https://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.
_______________________________________________
rsyslog mailing list
https://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.
Re: How can a config-let know what RuleSet is currently active? [ In reply to ]
Thanks Rainer!
I need to better explain the situation - my description was not detailed
enough.

I don't have control over the main cfg file (/etc/rsyslog.conf). I'm
creating a package - sort of a plugin - that deposits its config-let in
/etc/rsyslog.d/ , to be pulled in by the main config file.
The thing is, it may be pulled in several different ways, depending on the
master file and user configuration. In some cases it might even be pulled in
twice, under different $RuleSet directives.

My include file should work in all those scenarios... Which is what I'm
struggling with.

e.g.:
...
(include all files in .../rsyslog.d/)
...
$RuleSet a
(include all files in .../rsyslog.d/)
$RuleSet b
(include all files in .../rsyslog.d/)


Tried making a $RuleSet directive that is conditional, which obviously
failed. I'm pulling my hair on this one...

Thanks,
Doron



rsyslog-users mailing list wrote
> maybe doing a
>
> set $.rulesetname = "nameOfRuleset";
>
> right after the $ruleset directive?
>
> Rainer
>
> El mar., 20 oct. 2020 a las 14:12, doron via rsyslog
> (&lt;

> rsyslog@.adiscon

> &gt;) escribió:
>>
>> Hi folks - any thoughts re this?
>>
>> I have read the correspondence re "ruleset as a variable". Could not
>> solve
>> my case: my included file might be pulled into the main config file in
>> different locations / sections, under different (legacy syntax) $RuleSet
>> directives. I can't seem to find a good way to have my message filters be
>> included, but always leave the "current" ruleset in effect.
>>
>> Thanks!
>>
>>
>>
>> rsyslog-users mailing list wrote
>> > Hi folks,
>> >
>> > New to the ML.
>> > I have a config file part (pulled from .../rsyslog.d/) which, due to
>> the
>> > structure of the config process, *might* be pulled in in different
>> parts
>> > of the config file.
>> >
>> > It would be really helpful if I could figure out the currently active
>> > RuleSet when my config code runs. I was looking for $RuleSet as a
>> property
>> > I can query, but that's not available.
>> >
>> > Any other way to do that?
>> >
>> > Thanks in advance for any insight.





--
Sent from: http://rsyslog-users.1305293.n2.nabble.com/
_______________________________________________
rsyslog mailing list
https://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.