https://github.com/jcustenborder/netty-codec-syslog
Netty codec for syslog
https://github.com/jcustenborder/netty-codec-syslog
codec netty syslog
Last synced: 8 months ago
JSON representation
Netty codec for syslog
- Host: GitHub
- URL: https://github.com/jcustenborder/netty-codec-syslog
- Owner: jcustenborder
- License: apache-2.0
- Created: 2017-08-09T01:35:59.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-08-04T03:16:33.000Z (almost 8 years ago)
- Last Synced: 2023-07-26T21:58:48.215Z (almost 3 years ago)
- Topics: codec, netty, syslog
- Language: Java
- Size: 242 KB
- Stars: 10
- Watchers: 2
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[]()
# Introduction
This project provides a [Netty](http://netty.io) based solution for receiving syslog messages. The
following formats are currently supported. The mechanism for parsing log messages is plugable. You
can add support for additional formats by implementing a
[MessageParser](src/main/java/com/github/jcustenborder/netty/syslog/MessageParser.java) for the
format you wish to support.
* [RFC 3164 - The BSD Syslog Protocol](https://tools.ietf.org/html/rfc3164)
* [RFC 5424 - The Syslog Protocol](https://tools.ietf.org/html/rfc5424)
* [CEF - ArcSight Common Event Format](https://community.softwaregrp.com/t5/ArcSight-Connectors/ArcSight-Common-Event-Format-CEF-Guide/ta-p/1589306)
# Setting up a listener
## UDP
```java
Bootstrap b = new Bootstrap();
b.group(workerGroup)
.channel(NioDatagramChannel.class)
.handler(new ChannelInitializer() {
@Override
protected void initChannel(DatagramChannel datagramChannel) throws Exception {
ChannelPipeline channelPipeline = datagramChannel.pipeline();
channelPipeline.addLast(
new UDPSyslogMessageDecoder(),
new SyslogMessageHandler(),
handler
);
}
});
return b.bind(InetAddress.getLoopbackAddress(), port());
```
# Building
```bash
mvn clean install
```