[syslog-ng] how rewrite the HOST macro?

mobidyc mobidyc at gmail.com
Sun Aug 12 03:19:18 CEST 2007


Thanks for your answer,

is there a way to create my own macro?
i could pass the HOST macro through sed with program() and indicate a 
good destination file path.

i've around 300 servers to log, it would be difficult to maintain if all 
is not coherent.


Russell Fulton wrote:
> There are two places syslog-ng gets host names from -- firstly there is
> a macro (FROM_HOST ??) which is the name of the machine that syslog-ng
> received the record from and then there is the HOST macro with contains
> the the name that was in the hostname field of the syslog record.
>
> So, as I see it there are two possible ways to map all the different
> names to one.
>
> Firstly you could relay the syslog records through another machine so
> they all get the same hostname or
> secondly you may be able to tweak syslog on the source machine to write
> the records with a the name server0 in them.
>
> I know this isn't exactly what you asked but I don't think there is any
> way of directly fiddling with the hostname, I'm sure Balasz will correct
> me if I'm wrong.
>
> mobidyc wrote:
>   
>> Hello,
>>
>> i want to use syslog-ng to receive and log messages, the goal is to write log messages to:
>> /appli/syslog-ng/logs/server0/messages
>>
>> but server0 can have multiples names:
>> server0
>> server0e1
>> server0e2
>> server0g1
>> server0g2
>> server0gt1
>> etc...
>>
>> how can retrieve the name "server0" only ?
>>
>>
>> Regards,
>> Mobidyc
>>
>> _______________________________________________
>> syslog-ng maillist  -  syslog-ng at lists.balabit.hu
>> https://lists.balabit.hu/mailman/listinfo/syslog-ng
>> Frequently asked questions at http://www.campin.net/syslog-ng/faq.html
>>
>>   
>>     
> _______________________________________________
> syslog-ng maillist  -  syslog-ng at lists.balabit.hu
> https://lists.balabit.hu/mailman/listinfo/syslog-ng
> Frequently asked questions at http://www.campin.net/syslog-ng/faq.html
>
>
>   



More information about the syslog-ng mailing list