Sorry for the noise, I should have used my brain first. It is of course: %$.SERVICE%
Thanks Ede Am Wed, 22 Jun 2022 11:35:48 +0200 schrieb Ede Wolf via rsyslog <[email protected]>: > Hello, > > As so many before me, I am struggeling with the variables. Or > properties. More precisely, on how to address or evaluate them. A > simple example, that obviously does not work: > > --- > > set $.SERVICE = "default"; > > if ($fromhost-ip == "192.168.1.12" or $fromhost-ip == "192.168.1.15") > then { > > set $.SERVICE = "test"; > > } > > template (name="DynServiceLogFile" type="string" > string="/var/log/$.SERVICE/%HOSTNAME%/system.log") > > *.* action(type="omfile" dynaFile="DynServiceLogFile" > template="RSYSLOG_FileFormat") > > --- > > This actually does create a literal "$.SERVICE" directory, but not > one that corresponds to the value of the variable, as of course > desired. Not exactly sure, what I am missing here. > > Any hints to documentation that elaborated a little more on that? The > "Variable (Property) types" documentation page only talks about > setting them, but not on how to evaluate. Or my english lacks. Quite > possible as well > > Thanks for any help or insight > > Ede > _______________________________________________ > 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.

