IETF syslog input to fluentd - syslog

Is there any way to support IETF / RFC 5424 syslog messages with fluentd? My application has no disk, so tailing a file is not an option. The system already outputs standard syslog messages, but it looks like fluentd's syslog plugin is not, by default, able to parse the RFC 5424 message format.

A Fluentd maintainer here.
You are correct: in the past, Fluentd only supported a "default" syslog message via in_syslog. Hopefully in the next version, we have in_tcp and in_udp which accept arbitrary input format, including RFC 5424 syslog format. Here is a pull request for it

Related

Syslog RFC5424 Vs RFC6587

I was reading across the net, and I wasn't able to find what are the differences between those protocols when Syslog message is being sent, nor a proper example for how RFC6587 log messages look like. If someone can share some insight regarding those two questions.
The 2 RFCs are for different purposes.
RFC 5424 defines a "modern" log format with structural elements, while RFC 6587 can be considered as transport for such a log format over TCP.
RFC 6587 defines frames around syslog messages, and it also mentions/suggests RFC 5424 as payload:
https://datatracker.ietf.org/doc/html/rfc6587#section-3.4.1
SYSLOG-MSG is defined in the syslog protocol [RFC5424] and may
also be considered to be the payload in [RFC3164]
Example for RFC 5424:
<165>1 2003-10-11T22:14:15.003Z mymachine.example.com evntslog - ID47 [exampleSDID#32473 iut="3" eventSource="Application" eventID="1011"] BOMAn application event log entry...
RFC 6587 is just about framing, so the example would be the same, but with prepending the length of the message: MSG-LEN SP SYSLOG-MSG.

How to configure Log4cplus Syslog Appender

I want to configure Log4cplus Syslog appender to log messages only under certain conditions, by configuring the Log4cplus config file.
The conditions I want to configure are the followings:
1) use sync/Async sending of log messages to Syslog
2) log only messages that contain a certain string/text (for example to log only messages containing the text: "Fail to connect").
log4cplus.appender.syslog=log4cplus::SysLogAppende
log4cplus.appender.syslog.ident=syslog
log4cplus.appender.syslog.layout=log4cplus::PatternLayout log4cplus.appender.syslog.layout.ConversionPattern=[%T] %-5p %b %x - %m%n
log4cplus.appender.syslog.host=localhost
log4cplus.appender.syslog.udp=true
log4cplus.appender.syslog.port=514
log4cplus.appender.syslog.facility=user
Is there a way to configure these parameters?
log4cplus.appender.syslog=log4cplus::SysLogAppende
You are missing r.
log4cplus.appender.syslog.layout=log4cplus::PatternLayout log4cplus.appender.syslog.layout.ConversionPattern=[%T] %-5p %b %x - %m%n
This should be two lines, not one.
log4cplus.appender.syslog.host=localhost
log4cplus.appender.syslog.udp=true
log4cplus.appender.syslog.port=514
You do not need to use UDP to log into local syslog on *NIX OS. If you do still want to log into remote syslog using UDP, do not forget to configure the target syslogd or similar software to actually accept logging messages from UDP. The default is usually to have remote syslog disabled.

Protocol Buffer Wireshark Plugin

I am looking for a wireshark plugin for google protocol buffer. And I found this GPB Wireshark plugin http://code.google.com/p/protobuf-wireshark/
Apparently only UDP….Is there a GPB plugin for wireshark that works for TCP?
You could use Protobuf dissector shipped with Wireshark instead. Since Wireshark 3.2.0, the *.proto files can now be configured to enable more precise parsing of serialized Protobuf data (such as gRPC).
Parsing Protobuf data based on UDP port is supported since that version. And you can also write a simple dissector to invoke Protobuf dissector for TCP by passing message type through 'data' parameter in C or pinfo.private["pb_msg_type"] in lua.
You may get detail from the release note (https://www.wireshark.org/docs/relnotes/wireshark-3.2.0.html).
The detail of invoking Protobuf dissector in your own dissector is on https://www.wireshark.org/docs/wsug_html_chunked/ChProtobufUDPMessageTypes.html.
This plugin only supports wireshark 10.0.2.

Linux Syslog Server Format

I am creating a syslog formatted message according to RFC3164 and sending it to my linux default syslog server which is listining of port 514.
The message i am sending is
<187>Nov 19 02:58:57 nms-server6 %cgmesh-2-outage: Outage detected on this device
I open a socket, make a datagram packet and send this packet on that socket.
Now in the var/log/syslog.log which i have configured to receive all the syslog messages as
. /var/log/syslog.log
I am getting this extra hostname getting inserted by the server automatically as show below
Nov 19 02:58:57 nms-server6 nms-server6 %cgmesh-2-outage: Outage detected on this device
as you see nms-server6 is getting repeated twice while i am sending it just once...so somehow the server is inserting it by default..
can some one share some knowledge on this ?
Are you adding the hostname in your message? If so, I don't think that's necessary as the hostname will be taken from the packet - which would explain the duplication.
Also, as a side note - it's nice that you've added the %fac-sev-mnemonic: portion, but that is not a standard, it's used by Cisco devices.
Here's a link to a good whitepaper that covers Cisco Mnemonics (and syslog management):
Building Scalable Syslog Management Solutions:
http://www.cisco.com/en/US/technologies/collateral/tk869/tk769/white_paper_c11-557812.html

Does Syslog really have a 1KB message limit?

It seems Syslog has a 1KB message limit. Is this hardcoded into the Syslog protocol, or is this a parameter that can be set for each server?
I am hoping the article I read was out of date, so if you have any info please share.
This is correct, as can be seen in the syslog protocol RFC. This, and other deficiencies in the syslog protocol, is the reason why modern syslog daemons such as rsyslog support enhanced protocols with features such as TCP transport, encryption etc. There was also some effort within the IETF to standardize an improved syslog protocol, which resulted in RFC5424, RFC5425, and RFC 5426. Here, the minimum maximum message size is relatively small (depending on the transport layer), however implementations are allowed to support larger messages as well.
From my reading of the syslog protocol spec (well, draft standard), message packets can't be more than 1KiB, but (using a fragmentation feature) messages can be. RFC 5424, however, says message size depends on transport, but is at least 480 octets.
Yes, but you can increase this limit to an arbitrary length by recompiling from source.
See instructions in this blog post I found about truncated syslog messages: http://bsdpants.blogspot.com/2010/08/truncated-syslog-messages.html

Resources