I have created a syslog server and client. I want to set client serial number in SOURCE macro in all logs being sent to server so that on server side I can retrieve the macro and can create the log file based on client serial number. Following is my rewrite rule:
rewrite set_host{
set("DEVICE_SERIAL_NO", value("SOURCE"));
};
log { source(s_src); rewrite(set_host); destination(d_net); };
On server side I have written following configuration for log file:
destination d_host-specific {
file("/var/log/testlogs/$SOURCE/$YEAR/$MONTH/$HOST-$YEAR-$MONTH-$DAY.log");
};
But on server side I get value of $SOURCE as s_net. Seems like SOURCE macro is over-written on server side. How to sustain a macro from client to server and use it on server side?