<HTML>
<HEAD>
<TITLE>Syslog-ng is always one message behing with a tcp destination</TITLE>
</HEAD>
<BODY>
<BLOCKQUOTE><FONT SIZE="4"><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hi,<BR>
<BR>
I have a "client" syslog-ng that reads from a unix domain socket and writes to a file destination as well as a tcp destination. I have a "server" syslog-ng listening on 0.0.0.0 on the port specified in the "client" tcp destination.<BR>
<BR>
When I write a sample payload to the domain socket, syslog-ng writes the message in full to the file destination immediately. However I see no file created on the host referred to by tcp destination.<BR>
<BR>
If I write a second payload, the first payload is now written to the remote location specified in the tcp destination.<BR>
<BR>
It seems like syslog-ng is always one message behind in writing to the tcp destination.<BR>
<BR>
I am able to flush the "client" syslog-ng buffer by sending a kill -1. This causes the payload to be written to the tcp destination.<BR>
<BR>
Is this the only way to force syslog-ng to write all its buffer contents to the tcp destination? Or is there someway to control the flushing using flow-control?<BR>
<BR>
<BR>
"client" syslog-ng configuration:<BR>
<BR>
@version: 3.0<BR>
<BR>
options {<BR>
flush_timeout(1000);<BR>
};<BR>
<BR>
source s_socks {<BR>
unix-stream ("/home/srini/dev/log"<BR>
max-connections(5)<BR>
log_msg_size(3145728)<BR>
flags(no-parse));<BR>
<BR>
};<BR>
<BR>
destination d_logs {<BR>
file("/logs/app.log");<BR>
};<BR>
<BR>
destination d_tcp {<BR>
tcp("192.168.1.102" port(60999)<BR>
frac_digits(6)<BR>
keep-alive(yes)<BR>
);<BR>
};<BR>
<BR>
rewrite r_rewrite_newlines{<BR>
subst("#012", "\n", value("MESSAGE"), flags("global"));<BR>
};<BR>
<BR>
log {<BR>
source(s_socks);<BR>
rewrite(r_rewrite_newlines);<BR>
destination(d_logs);<BR>
};<BR>
<BR>
log {<BR>
source(s_socks);<BR>
destination(d_tcp);<BR>
};<BR>
<BR>
<BR>
"Server" syslog-ng: This is the "centralized" log server:<BR>
<BR>
@version: 3.0<BR>
<BR>
source s_tcp {<BR>
tcp(port(60999))<BR>
log_msg_size(3145728)<BR>
keep-alive(yes)<BR>
};<BR>
<BR>
<BR>
destination d_logs {<BR>
file("/logs/app.llog"<BR>
};<BR>
<BR>
rewrite r_rewrite_newlines{<BR>
subst("#012", "\n", value("MESSAGE"), flags("global"));<BR>
};<BR>
<BR>
log {<BR>
source(s_tcp);<BR>
rewrite(r_rewrite_newlines);<BR>
destination(d_logs);<BR>
};<BR>
<BR>
<BR>
Thanks.<BR>
Srini <BR>
<BR>
</SPAN></FONT></FONT></BLOCKQUOTE>
</BODY>
</HTML>