Introduction
This project provides support for receiving NetFlow data from network devices using Netty. Currently only NetFlow v9 is supported. There are plans to support NetFlow v5 in a future release.
Usage
Pipeline Configuration
Bootstrap b = new Bootstrap();
b.group(bossGroup)
.channel(NioDatagramChannel.class)
.handler(new ChannelInitializer<DatagramChannel>() {
@Override
protected void initChannel(DatagramChannel datagramChannel) throws Exception {
ChannelPipeline channelPipeline = datagramChannel.pipeline();
channelPipeline.addLast(
new LoggingHandler("NetFlow", LogLevel.TRACE),
new NetFlowV9Decoder(),
new NetFlowV9RequestHandler()
);
}
});
NetFlow Message Processing
class NetFlowV9RequestHandler extends SimpleChannelInboundHandler<NetFlowV9Decoder.NetFlowMessage> {
@Override
protected void channelRead0(ChannelHandlerContext channelHandlerContext, NetFlowV9Decoder.NetFlowMessage netFlowMessage) throws Exception {
}
}