We are using logstash as syslog event receiver and forwarder using UDP & TCP and it is doing as expected but on forwarding syslog events to output, logstash is adding its own header, we want to remove this header from syslog. Please find below expected syslog and the syslog received from logstash
Expected syslog
Nov 23 10:11:39 127.0.0.1 token1: expired, successful,Info,0000,00002,Linux,Test
As you can see extra logstash header info is getting appended in the syslog. Kindly suggest how to remove this header.
I have seen other threads with similar problems as well but it didnt solve the purpose.
input {
syslog {
port => 1468
}
udp {
port => 514
type => syslog
}
}
output {
tcp{
host => "10.140.190.105"
port => 1468
codec => line {
format => "%{message}"
}
}
}
But now facing a new issue i.e. while sending syslog event output some times TCP hangs and then outputs the syslog event. The major problem here is that if any event comes in between for output, because TCP output is hanged, the event drop or not sent.
Here is the ruby code that that warning log message is coming from:
begin
client_socket = connect unless client_socket
r,w,e = IO.select([client_socket], [client_socket], [client_socket], nil)
# don't expect any reads, but a readable socket might
# mean the remote end closed, so read it and throw it away.
# we'll get an EOFError if it happens.
client_socket.sysread(16384) if r.any?
# Now send the payload
client_socket.syswrite(payload) if w.any?
rescue => e
@logger.warn("tcp output exception", :host => @host, :port => @port,
:exception => e, :backtrace => e.backtrace)
client_socket.close rescue nil
client_socket = nil
sleep @reconnect_interval
retry
end
This seems to mean that the remote end closed early and we sleep and retry at the default reconnect_interval of 10 seconds.
I suggest that you investigate the network activity, correct the problem and reduce the reconnect_interval to 1 second.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.