How to Get Netflow Packet Stream Information

I used jflow to capture netflow packages. By running the print example , I could observe this kind of output.

13.243.146.68.41472 -> 10.100.0.126.13570 285212682 0
0.43.0.0.18 -> 0.199.0.0.4352 8321715 100
53.2.7.225.3571 -> 0.0.1.67.37446 323 5
1.187.0.3.323 -> 6.0.0.10.28807 0 183
0.0.0.0.0 -> 0.0.0.0.3571 0 10
1.1.0.53.0 -> 0.18.17.0.323 889257984 26
0.0.0.0.0 -> 0.0.0.0.0 0 146
192.168.1.1.6775 -> 0.53.0.18.0 754988289 112

This is like printing inside the DatagramSocket.receive (DatagramPacket) method. How can I print this data, such as host address, destination address, etc. Netflow entries yourself.

Also, I could not understand what the last two parameters of the above output mean.

+4
source share
1 answer

If you look at the source of jflow, you will see what exactly it prints.

The related code calls:

      System.out.println(f.toShortString());

, nettrack.net.netflow.Flow:: toShortString, , :

public String toShortString()
{
  return
    IpAddr.toString(getSrcAddr())+"."+getSrcPort()+" -> "+
    IpAddr.toString(getDstAddr())+"."+getDstPort()+" "+
    getDOctets();
}  

, , getDOctets.

https://github.com/aptivate/netgraph/blob/master/jflow-0.3/src/nettrack/net/netflow/Flow.java

0

All Articles