I have two machines, “here” and “there”.
“there” creates an output file and sends it to “here” for some processing. “here” runs a shell script on the output and uses logger to send the results to a syslog aggregator. Unfortunately, the log aggregator sees the message as coming from “here”, but I want it appear that the message came from “there”.
In short, I run:
echo "Hello World"|logger -p local1.alert
and get:
2010-11-09T15:40:11.516811-06:00 here logger: Hello World
but want:
2010-11-09T15:40:11.516811-06:00 there logger: Hello World
Is there a way to use logger to make the traffic appear from a different host? The actual message format I use cannot be changed.
I believe the answer with logger is “no”.
logger probably uses the syslog(3) library routine which has no provision for setting the host in a log entry.
You could write your own version of logger that sends the logs over the wire the way you want. http://www.faqs.org/rfcs/rfc3164.html