[syslog-ng] Use receiving file name / path as a macro on the server

Thanuje Ashwin Nallaperuma thanuje88 at gmail.com
Mon Mar 9 11:39:47 CET 2015


Hi Gergely,

This worked. :)
Thank you very much

On Tue, Mar 3, 2015 at 6:11 PM, Gergely Nagy <algernon at madhouse-project.org>
wrote:

> >>>>> "Thanuje" == Thanuje Ashwin Nallaperuma <thanuje88 at gmail.com>
> writes:
>
>     Thanuje> I have multiple files with the same content on the syslog-ng
> client
>     Thanuje> These files are stored on different locations with the same
> file name and
>     Thanuje> same content
>     Thanuje> After receiving I want to store these files with different
> names on
>     Thanuje> sysog-ng server
>     Thanuje> Is there any way I could use the filepath or filename of the
> receiving file
>     Thanuje> as a macro
>     Thanuje> or any way to achieve this..?
>
> When sending the message, the $FILE_NAME macro contains the path of the
> file. You can add it to the template on the sending end, and extract it
> on the receiving end, and use that as you will.
>
> The easiest way to accomplish this is either $(format-json) (and
> json-parser() on the other end), or using RFC 5424 syslog(), and setting
> SDATA.filename (or somesuch) to $FILE_NAME in a rewrite rule. That way,
> it will be automatically available on the receiving end, and you can
> transform them in whatever way you prefer.
>
> --
> |8]
>
> ______________________________________________________________________________
> Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
> Documentation:
> http://www.balabit.com/support/documentation/?product=syslog-ng
> FAQ: http://www.balabit.com/wiki/syslog-ng-faq
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.balabit.hu/pipermail/syslog-ng/attachments/20150309/1c608e74/attachment.htm 


More information about the syslog-ng mailing list