<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">I do this by adding the following to my
config file<br>
<br>
@module confgen context(rewrite) name(r_myself)
exec("/bin/hostname")<br>
<br>
rewrite r_local {<br>
set( r_myself(), value("HOST") );<br>
};<br>
<br>
log {<br>
source(s_your_source);<br>
rewrite(r_local);<br>
destination(d_your_destination);<br>
};<br>
<br>
<br>
<br>
<br>
<br>
hope that helps.<br>
<br>
<br>
<br>
On 08/29/2016 06:35 AM, Robert Blayzor wrote:<br>
</div>
<blockquote cite="mid:11745015-4A56-483E-BEEE-75D76F68AF9D@inoc.net"
type="cite">
<pre wrap="">On Aug 29, 2016, at 9:22 AM, Fabien Wernli <a class="moz-txt-link-rfc2396E" href="mailto:wernli@in2p3.fr"><wernli@in2p3.fr></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">
The backticks replace content, so you end up with a literal in your config.
Try this instead:
rewrite r_host { set("`HOSTNAME`", value("HOST")); };
</pre>
</blockquote>
<pre wrap="">
That certainly fixes the config from complaining, but I now just get an empty string; for which syslog-ng replaces with the hosts IP instead.
I’m just trying to re-write each messages host with the hostname of the current server.
______________________________________________________________________________
Member info: <a class="moz-txt-link-freetext" href="https://lists.balabit.hu/mailman/listinfo/syslog-ng">https://lists.balabit.hu/mailman/listinfo/syslog-ng</a>
Documentation: <a class="moz-txt-link-freetext" href="http://www.balabit.com/support/documentation/?product=syslog-ng">http://www.balabit.com/support/documentation/?product=syslog-ng</a>
FAQ: <a class="moz-txt-link-freetext" href="http://www.balabit.com/wiki/syslog-ng-faq">http://www.balabit.com/wiki/syslog-ng-faq</a>
</pre>
</blockquote>
<br>
<p><br>
</p>
<pre class="moz-signature" cols="500">--
Evan Rempel <a class="moz-txt-link-abbreviated" href="mailto:erempel@uvic.ca">erempel@uvic.ca</a>
Senior Systems Administrator 250.721.7691
Data Centre Services, University Systems, University of Victoria
</pre>
</body>
</html>