[syslog-ng] Rewrite set var value with tag?
Fabien Wernli
wernli at in2p3.fr
Fri Jan 17 08:14:51 UTC 2020
On Thu, Jan 16, 2020 at 09:24:27PM +0000, Faine, Mark R. (MSFC-IS40)[NICS] wrote:
> Is it possible to do something like:
>
> rewrite {
> set-tag("bar");
> };
>
> And then use a rewrite to set the value of a variable to the value of the tag
A tag doesn't have a value. The $TAGS macro contains the list of all tags.
> I need to set a value that I've determined in a log path at the top of the file in several log paths that occur after. It looks the scope for variables is at the log path level so that doesn't help me. I'm also trying to avoid nesting all of the other log paths inside of the top log path where I determine the value.
The scope of macros (aka name-value pairs or variables as you call them) and tags is the message.
I think you're misunderstanding this.
Once you do, step back and explain what you're trying to achieve :)
More information about the syslog-ng
mailing list