logstash-codec-netflow 3.10.0 → 3.11.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-codec-netflow'
4
- s.version = '3.10.0'
4
+ s.version = '3.11.0'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Reads Netflow v5 and Netflow v9 data"
7
7
  s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.metadata = { "logstash_plugin" => "true", "logstash_group" => "codec" }
21
21
 
22
22
  # Gem dependencies
23
- s.add_runtime_dependency "logstash-core-plugin-api", ">= 1.60", "<= 2.99"
23
+ s.add_runtime_dependency "logstash-core-plugin-api", "~> 2.0"
24
24
  s.add_runtime_dependency 'bindata', ['>= 1.5.0']
25
25
  s.add_development_dependency 'logstash-devutils', ['>= 1.0.0']
26
26
  end
@@ -0,0 +1,23 @@
1
+ import socket
2
+ import sys
3
+ import time
4
+
5
+
6
+ # Netflow v9 template
7
+ tpl = '\x00\t\x00\r\x00\x1fz\xc4V\x17\x8dE\x00\x00\x02\x95\x00\x00\x00\x00\x00\x00\x03\xe0\x01\x00\x00\x15\x00\x94\x00\x04\x00\x08\x00\x04\x00\x07\x00\x02\x00\n\x00\x02\x00\x0c\x00\x04\x00\x0b\x00\x02\x00\x0e\x00\x02\x00\x04\x00\x01\x00\xb0\x00\x01\x00\xb1\x00\x01\x9cA\x00\x04\x9cB\x00\x04\x9cC\x00\x02\x9cD\x00\x02\x9cE\x00\x01\x80\xea\x00\x02\x01C\x00\x08\x00U\x00\x04\x80\xe8\x00\x0c\x80\xe9\x00\x0c\x9c@\x00\x14\x01\x01\x00\x15\x00\x94\x00\x04\x00\x08\x00\x04\x00\x07\x00\x02\x00\n\x00\x02\x00\x0c\x00\x04\x00\x0b\x00\x02\x00\x0e\x00\x02\x00\x04\x00\x01\x00\xb0\x00\x01\x00\xb1\x00\x01\x9cA\x00\x04\x9cB\x00\x04\x9cC\x00\x02\x9cD\x00\x02\x9cE\x00\x01\x80\xea\x00\x02\x01C\x00\x08\x00U\x00\x04\x80\xe8\x00\x0c\x80\xe9\x00\x0c\x9c@\x00A\x01\x02\x00\x11\x00\x94\x00\x04\x00\x1b\x00\x10\x00\x07\x00\x02\x00\n\x00\x02\x00\x1c\x00\x10\x00\x0b\x00\x02\x00\x0e\x00\x02\x00\x04\x00\x01\x00\xb2\x00\x01\x00\xb3\x00\x01\x9cE\x00\x01\x80\xea\x00\x02\x01C\x00\x08\x00U\x00\x04\x80\xe8\x00\x0c\x80\xe9\x00\x0c\x9c@\x00\x14\x01\x03\x00\x11\x00\x94\x00\x04\x00\x1b\x00\x10\x00\x07\x00\x02\x00\n\x00\x02\x00\x1c\x00\x10\x00\x0b\x00\x02\x00\x0e\x00\x02\x00\x04\x00\x01\x00\xb2\x00\x01\x00\xb3\x00\x01\x9cE\x00\x01\x80\xea\x00\x02\x01C\x00\x08\x00U\x00\x04\x80\xe8\x00\x0c\x80\xe9\x00\x0c\x9c@\x00A\x01\x04\x00\x12\x00\x08\x00\x04\x00\x07\x00\x02\x00\n\x00\x02\x00\x0c\x00\x04\x00\x0b\x00\x02\x00\x0e\x00\x02\x00\x04\x00\x01\x00\xb0\x00\x01\x00\xb1\x00\x01\x9cA\x00\x04\x9cB\x00\x04\x9cC\x00\x02\x9cD\x00\x02\x9cE\x00\x01\x80\xea\x00\x02\x01C\x00\x08\x80\xe8\x00\x0c\x80\xe9\x00\x0c\x01\x05\x00\x0e\x00\x08\x00\x04\x00\x07\x00\x02\x00\n\x00\x02\x00\x0c\x00\x04\x00\x0b\x00\x02\x00\x0e\x00\x02\x00\x04\x00\x01\x00\xb0\x00\x01\x00\xb1\x00\x01\x9cE\x00\x01\x80\xea\x00\x02\x01C\x00\x08\x80\xe8\x00\x0c\x80\xe9\x00\x0c\x01\x06\x00\x0e\x00\x1b\x00\x10\x00\x07\x00\x02\x00\n\x00\x02\x00\x1c\x00\x10\x00\x0b\x00\x02\x00\x0e\x00\x02\x00\x04\x00\x01\x00\xb2\x00\x01\x00\xb3\x00\x01\x9cE\x00\x01\x80\xea\x00\x02\x01C\x00\x08\x80\xe8\x00\x0c\x80\xe9\x00\x0c\x01\x07\x00\x12\x00\x94\x00\x04\x00\x08\x00\x04\x00\x07\x00\x02\x00\n\x00\x02\x00\x0c\x00\x04\x00\x0b\x00\x02\x00\x0e\x00\x02\x00\x04\x00\x01\x00\xb0\x00\x01\x00\xb1\x00\x01\x9cA\x00\x04\x9cB\x00\x04\x9cC\x00\x02\x9cD\x00\x02\x9cE\x00\x01\x80\xea\x00\x02\x01C\x00\x08\x00U\x00\x04\x01\x08\x00\x0e\x00\x94\x00\x04\x00\x1b\x00\x10\x00\x07\x00\x02\x00\n\x00\x02\x00\x1c\x00\x10\x00\x0b\x00\x02\x00\x0e\x00\x02\x00\x04\x00\x01\x00\xb2\x00\x01\x00\xb3\x00\x01\x9cE\x00\x01\x80\xea\x00\x02\x01C\x00\x08\x00U\x00\x04\x01\t\x00\x16\x00\x94\x00\x04\x00\x08\x00\x04\x00\x07\x00\x02\x00\n\x00\x02\x00\x0c\x00\x04\x00\x0b\x00\x02\x00\x0e\x00\x02\x00\x04\x00\x01\x00\xb0\x00\x01\x00\xb1\x00\x01\x9cA\x00\x04\x9cB\x00\x04\x9cC\x00\x02\x9cD\x00\x02\x9cE\x00\x01\x80\xea\x00\x02\x01C\x00\x08\x00U\x00\x04\x00\x98\x00\x08\x80\xe8\x00\x0c\x80\xe9\x00\x0c\x9c@\x00\x14\x01\n\x00\x16\x00\x94\x00\x04\x00\x08\x00\x04\x00\x07\x00\x02\x00\n\x00\x02\x00\x0c\x00\x04\x00\x0b\x00\x02\x00\x0e\x00\x02\x00\x04\x00\x01\x00\xb0\x00\x01\x00\xb1\x00\x01\x9cA\x00\x04\x9cB\x00\x04\x9cC\x00\x02\x9cD\x00\x02\x9cE\x00\x01\x80\xea\x00\x02\x01C\x00\x08\x00U\x00\x04\x00\x98\x00\x08\x80\xe8\x00\x0c\x80\xe9\x00\x0c\x9c@\x00A\x01\x0b\x00\x12\x00\x94\x00\x04\x00\x1b\x00\x10\x00\x07\x00\x02\x00\n\x00\x02\x00\x1c\x00\x10\x00\x0b\x00\x02\x00\x0e\x00\x02\x00\x04\x00\x01\x00\xb2\x00\x01\x00\xb3\x00\x01\x9cE\x00\x01\x80\xea\x00\x02\x01C\x00\x08\x00U\x00\x04\x00\x98\x00\x08\x80\xe8\x00\x0c\x80\xe9\x00\x0c\x9c@\x00\x14\x01\x0c\x00\x12\x00\x94\x00\x04\x00\x1b\x00\x10\x00\x07\x00\x02\x00\n\x00\x02\x00\x1c\x00\x10\x00\x0b\x00\x02\x00\x0e\x00\x02\x00\x04\x00\x01\x00\xb2\x00\x01\x00\xb3\x00\x01\x9cE\x00\x01\x80\xea\x00\x02\x01C\x00\x08\x00U\x00\x04\x00\x98\x00\x08\x80\xe8\x00\x0c\x80\xe9\x00\x0c\x9c@\x00A'
8
+
9
+ # Cisco ASA 14 flows:
10
+ data = '\x00\t\x00\x0e\x00\x1f\x80\xfdV\x17\x8dG\x00\x00\x02\x96\x00\x00\x00\x00\x01\t\x05\x98\x00\x00!4\xc0\xa8\x0e\x01\x00\x00\x00\x03\x02\x02\x02\x0bD\x8d\x00\x02\x01\x00\x00\xc0\xa8\x0e\x01\x02\x02\x02\x0b\x00\x00D\x8d\x02\x07\xe9\x00\x00\x01PK\xff\xd7\xdf\x00\x00\x008\x00\x00\x01PK\xff\xcf\xf1\x0f\x8e\x7f\xf3\xfc\x1a\x03\x0f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00!5\xc0\xa8\x17\x16D\x8d\x00\x02\xa4\xa4%\x0b\x00\x00\x00\x03\x01\x08\x00\xc0\xa8\x17\x16\xa4\xa4%\x0bD\x8d\x00\x00\x02\x07\xe9\x00\x00\x01PK\xff\xda#\x00\x00\x008\x00\x00\x01PK\xff\xd2I\x0f\x8e\x7f\xf3\xfc\x1a\x03\x0f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00!6\xa4\xa4%\x0b\x00\x00\x00\x03\xc0\xa8\x17\x16D\x8d\x00\x02\x01\x00\x00\xa4\xa4%\x0b\xc0\xa8\x17\x16\x00\x00D\x8d\x02\x07\xe9\x00\x00\x01PK\xff\xdaK\x00\x00\x008\x00\x00\x01PK\xff\xd2S\x0f\x8e\x7f\xf3\xfc\x1a\x03\x0f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00!7\xc0\xa8\x17\x14E\x8d\x00\x02\xa4\xa4%\x0b\x00\x00\x00\x03\x01\x08\x00\xc0\xa8\x17\x14\xa4\xa4%\x0bE\x8d\x00\x00\x02\x07\xe9\x00\x00\x01PK\xff\xdb\x13\x00\x00\x008\x00\x00\x01PK\xff\xd3/\x0f\x8e\x7f\xf3\xfc\x1a\x03\x0f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00!8\xa4\xa4%\x0b\x00\x00\x00\x03\xc0\xa8\x17\x14E\x8d\x00\x02\x01\x00\x00\xa4\xa4%\x0b\xc0\xa8\x17\x14\x00\x00E\x8d\x02\x07\xe9\x00\x00\x01PK\xff\xdb\x1d\x00\x00\x008\x00\x00\x01PK\xff\xd39\x0f\x8e\x7f\xf3\xfc\x1a\x03\x0f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00!9\xc0\xa8\x0e\x0bE\x8d\x00\x03\x02\x02\x02\x0b\x00\x00\x00\x02\x01\x08\x00\xc0\xa8\x0e\x0b\x02\x02\x02\x0bE\x8d\x00\x00\x02\x07\xe9\x00\x00\x01PK\xff\xdb\xdb\x00\x00\x008\x00\x00\x01PK\xff\xd3\xed\x0f\x8e\x7f\xf3\xfc\x1a\x03\x0f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00!:\x02\x02\x02\x0b\x00\x00\x00\x02\xc0\xa8\x0e\x0bE\x8d\x00\x03\x01\x00\x00\x02\x02\x02\x0b\xc0\xa8\x0e\x0b\x00\x00E\x8d\x02\x07\xe9\x00\x00\x01PK\xff\xdb\xef\x00\x00\x008\x00\x00\x01PK\xff\xd3\xf7\x0f\x8e\x7f\xf3\xfc\x1a\x03\x0f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00!;\x02\x02\x02\x0bE\x8d\x00\x02\xc0\xa8\x0e\x01\x00\x00\x00\x03\x01\x08\x00\x02\x02\x02\x0b\xc0\xa8\x0e\x01E\x8d\x00\x00\x02\x07\xe9\x00\x00\x01PK\xff\xdb\xef\x00\x00\x008\x00\x00\x01PK\xff\xd4\x01\x0f\x8e\x7f\xf3\xfc\x1a\x03\x0f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00!<\xc0\xa8\x0e\x01\x00\x00\x00\x03\x02\x02\x02\x0bE\x8d\x00\x02\x01\x00\x00\xc0\xa8\x0e\x01\x02\x02\x02\x0b\x00\x00E\x8d\x02\x07\xe9\x00\x00\x01PK\xff\xdb\xef\x00\x00\x008\x00\x00\x01PK\xff\xd4\x0b\x0f\x8e\x7f\xf3\xfc\x1a\x03\x0f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00!M\xa4\xa4%\x0b\x00\x00\x00\x03\xc0\xa8\x17\x01\x00\x00\x00\x02\x01\x03\x03\xa4\xa4%\x0b\xc0\xa8\x17\x01\x00\x00\x00\x00\x02\x07\xe0\x00\x00\x01PK\xff\xdee\x00\x00\x00\xa0\x00\x00\x01PK\xff\xdee\x0f\x8e\x7f\xf3\xfc\x1a\x03\x0f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00!=\xc0\xa8\x17\x16F\x8d\x00\x02\xa4\xa4%\x0b\x00\x00\x00\x03\x01\x08\x00\xc0\xa8\x17\x16\xa4\xa4%\x0bF\x8d\x00\x00\x02\x07\xe9\x00\x00\x01PK\xff\xdee\x00\x00\x008\x00\x00\x01PK\xff\xd6\x81\x0f\x8e\x7f\xf3\xfc\x1a\x03\x0f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00!>\xa4\xa4%\x0b\x00\x00\x00\x03\xc0\xa8\x17\x16F\x8d\x00\x02\x01\x00\x00\xa4\xa4%\x0b\xc0\xa8\x17\x16\x00\x00F\x8d\x02\x07\xe9\x00\x00\x01PK\xff\xdey\x00\x00\x008\x00\x00\x01PK\xff\xd6\x8b\x0f\x8e\x7f\xf3\xfc\x1a\x03\x0f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00!?\xc0\xa8\x17\x14F\x8d\x00\x02\xa4\xa4%\x0b\x00\x00\x00\x03\x01\x08\x00\xc0\xa8\x17\x14\xa4\xa4%\x0bF\x8d\x00\x00\x02\x07\xe9\x00\x00\x01PK\xff\xdfA\x00\x00\x008\x00\x00\x01PK\xff\xd7]\x0f\x8e\x7f\xf3\xfc\x1a\x03\x0f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00!@\xa4\xa4%\x0b\x00\x00\x00\x03\xc0\xa8\x17\x14F\x8d\x00\x02\x01\x00\x00\xa4\xa4%\x0b\xc0\xa8\x17\x14\x00\x00F\x8d\x02\x07\xe9\x00\x00\x01PK\xff\xdfU\x00\x00\x008\x00\x00\x01PK\xff\xd7g\x0f\x8e\x7f\xf3\xfc\x1a\x03\x0f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
11
+
12
+ host = 'host02'
13
+ port = 2055
14
+ N = 15000
15
+
16
+ sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
17
+ sock.sendto(tpl, (host, port))
18
+ time.sleep(0.2)
19
+
20
+
21
+ print("%d: started sending %d Cisco ASA flows in %d packets totaling %d bytes" % (time.time(),N*14, N, N*len(data)))
22
+ for i in range(0, N):
23
+ sock.sendto(data, (host, port))
@@ -0,0 +1,23 @@
1
+ import socket
2
+ import sys
3
+ import time
4
+
5
+
6
+ # Netflow v9 template
7
+ tpl = '\x00\t\x00\x01e\x9c\xc0_XF\x8eU\x01u\xc7\x03\x00\x00\x08\x81\x00\x00\x00d\x01\x04\x00\x17\x00\x02\x00\x04\x00\x01\x00\x04\x00\x08\x00\x04\x00\x0c\x00\x04\x00\n\x00\x04\x00\x0e\x00\x04\x00\x15\x00\x04\x00\x16\x00\x04\x00\x07\x00\x02\x00\x0b\x00\x02\x00\x10\x00\x04\x00\x11\x00\x04\x00\x12\x00\x04\x00\t\x00\x01\x00\r\x00\x01\x00\x04\x00\x01\x00\x06\x00\x01\x00\x05\x00\x01\x00=\x00\x01\x00Y\x00\x01\x000\x00\x02\x00\xea\x00\x04\x00\xeb\x00\x04'
8
+
9
+ # Netflow v9 data, 21 flows:
10
+ data = '\x00\t\x00\x15e\x9c\xbcqXF\x8eT\x01u\xc6\xa1\x00\x00\x08\x81\x01\x04\x05\\\x00\x00\x00\x01\x00\x00\x00(\n\x00\t\x92\n\x00\x1fQ\x00\x00\x00n\x00\x00\x00\x9ee\x9cG\x05e\x9cG\x05\xd3\x01\x01\xbb\x00\x00\x00\x00\x00\x00\xfb\xf0\n\x00\x0e!\x10\x14\x06\x10\x00\x01@\x00\x01`\x00\x00\x00`\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00h\n\x00\x11*\n\x00#\x04\x00\x00\x00W\x00\x00\x00\x9ee\x9cI\x88e\x9cG\x07\x8e\x84\x01\xbb\x00\x00\x00\x00\x00\x00\xfb\xf0\n\x00\x0e!\x15\x10\x06\x10\x00\x01@\x00\x01`\x00\x00\x00`\x00\x00\x00\x00\x00\x00\x01\x00\x00\x004\n\x00\x16o\n\x00"\x8d\x00\x00\x00h\x00\x00\x00\x9ee\x9cG\ne\x9cG\nA\xae\x01\xbb\x00\x00\x00\x00\x00\x00\xfb\xf0\n\x00\x0e!\x18\x10\x06\x11\x00\x01@\x00\x01`\x00\x00\x00`\x00\x00\x00\x00\x00\x00\x01\x00\x00\x01\xb3\n\x00\x17;\n\x00$\xaa\x00\x00\x00V\x00\x00\x00\x9ee\x9cG\x0ce\x9cG\x0c\x005\xfd,\x00\x00\x00\x00\x00\x00\xfb\xf1\n\x00\x0e\x1f\x19\x13\x11\x00\x00\x01@\x00\x01`\x00\x00\x00`\x00\x00\x00\x00\x00\x00\x01\x00\x00\x03\xc9\n\x00"G\n\x00\x14\xf2\x00\x00\x00\x9e\x00\x00\x00je\x9cG\re\x9cG\r\x01\xbb\x07\xdd\x00\x00\xfb\xf0\x00\x00\xff\xa2\n\x00\x12\x05\x10\x15\x06\x18\x00\x00@\x00\x01`\x00\x00\x00`\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00h\n\x00\n\x85\n\x00\x1ef\x00\x00\x00n\x00\x00\x00\x9ee\x9cG\re\x9cF\xba\x89\xc9\x00P\x00\x00\x00\x00\x00\x00\xfb\xf0\n\x00\x0e!\x10\x10\x06\x10\x00\x01@\x00\x01`\x00\x00\x00`\x00\x00\x00\x00\x00\x00\x01\x00\x00\x004\n\x00%\x1d\n\x00\x06\x18\x00\x00\x00f\x00\x00\x00\xa2e\x9cG\x10e\x9cG\x10\x00P\xdd\xc3\x00\x00;\x1d\x00\x00\xff\x97\n\x00\x00\xf2\x18\x10\x06\x10 \x00@\x00\x01`\x00\x00\x00`\x00\x00\x00\x00\x00\x00\x01\x00\x00\x02f\n\x00 \xb0\n\x00\x0bq\x00\x00\x00\x9e\x00\x00\x00.e\x9cG\x10e\x9cG\x10\x01\xbb\xdd\xfe\x00\x00\xfb\xf0\x00\x00\xff\x98\n\x00\x12i\x14\x10\x06\x18\x00\x00@\x00\x01`\x00\x00\x00`\x00\x00\x00\x00\x00\x00\x03\x00\x00\x10\xfe\n\x00\x0c\x15\n\x00\x0f&\x00\x00\x00W\x00\x00\x00\x9ee\x9cG\x11e\x9c1\xe7\x01\xbb\x9c\x8e\x00\x00\x80\xa6\x00\x00\xfb\xf2\n\x00\x0e\x1b\x18\x18\x06\x10\x00\x01@\x00\x01`\x00\x00\x00`\x00\x00\x00\x00\x00\x00\x02\x00\x00\x02\x15\n\x00\x04\xd4\n\x00\x03n\x00\x00\x00\xa2\x00\x00\x00fe\x9cT\x07e\x9cG\x12\xc6\x03\x01\xbb\x00\x00\xff\x97\x00\x00\x00F\n\x00\x10e\x10\x11\x06\x18\x00\x01@\x00\x01`\x00\x00\x00`\x00\x00\x00\x00\x00\x01E\x00\x005\\\n\x00!z\n\x00\x01\x88\x00\x00\x00\x9e\x00\x00\x00he\x9co\xd0e\x9c"\x1a\xe5\xbe\x00P\x00\x00\xfb\xf1\x00\x00\x00\x00\x00\x00\x00\x00\x15\x1b\x06\x10\x00\x00@\x00\x01`\x00\x00\x00`\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00Y\n\x00\x14\xf2\n\x00"G\x00\x00\x00j\x00\x00\x00\x9ee\x9cG\x14e\x9cG\x14\x07\xdd\x01\xbb\x00\x00\xff\xa2\x00\x00\xfb\xf0\n\x00\x0e!\x15\x10\x06\x18`\x01@\x00\x01`\x00\x00\x00`\x00\x00\x00\x00\x00\x00\x01\x00\x00\x03A\n\x00\r\x19\n\x00\x0f&\x00\x00\x00W\x00\x00\x00\x9ee\x9cG\x16e\x9cG\x16\x01\xbb\xc9\xa5\x00\x00\x80\xa6\x00\x00\xfb\xf2\n\x00\x0e\x1b\x18\x18\x06\x18\x00\x01@\x00\x01`\x00\x00\x00`\x00\x00\x00\x00\x00\x00\x02\x00\x00\x06Y\n\x00\x19;\n\x00\x02\x12\x00\x00\x00\x9e\x00\x00\x00ne\x9cG\x18e\x9cF\xbf\x01\xbb\xf4\x00\x00\x00\xfb\xf0\x00\x00\xff\x9d\n\x00\x12~\x10\x10\x06\x18\x00\x00@\x00\x01`\x00\x00\x00`\x00\x00\x00\x00\x00\x00a\x00\x02+h\n\x00\x07I\n\x00\x1b\xa8\x00\x00\x00V\x00\x00\x00\x9ee\x9cu\xabe\x9c1\xfe\xeb\x98\x01\xd1\x00\x00\xff\x9c\x00\x00\xfb\xf0\n\x00\x0e!\x10\x10\x06\x18\x00\x01@\x00\x01`\x00\x00\x00`\x00\x00\x00\x00\x00\x00:\x00\x00\x0b\xc8\n\x00\x132\n\x00\x1b\xa9\x00\x00\x00j\x00\x00\x00\x9ee\x9cO\xcbe\x9cE:\x86\x94\x03\xe3\x00\x00\xff\xb7\x00\x00\xfb\xf0\n\x00\x0e!\x12\x10\x06\x10\x00\x01@\x00\x01`\x00\x00\x00`\x00\x00\x00\x00\x00\x00\x15\x00\x00{\x0c\n\x00\x1c\x96\n\x00\x18\r\x00\x00\x00\x9e\x00\x00\x00he\x9cHYe\x9cF\xf0\x01\xbb\xc2\xfd\x00\x00\xfb\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x10\x19\x06\x10\x00\x00@\x00\x01`\x00\x00\x00`\x00\x00\x00\x00\x00\x00\x03\x00\x00\x0bg\n\x00\x1a\xbc\n\x00\x15\xc8\x00\x00\x00\x9e\x00\x00\x00We\x9cGfe\x9cE\xec\x03\xe1\xc4N\x00\x00\xfb\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x10\x19\x06\x18\x00\x00@\x00\x01`\x00\x00\x00`\x00\x00\x00\x00\x00\x00\x05\x00\x00\x11\xa2\n\x00\x1d"\n\x00\x0f&\x00\x00\x00K\x00\x00\x00\x9ee\x9cm`e\x9cA\xfe\x01\xbb\x8c\x8f\x00\x00;A\x00\x00\xfb\xf2\n\x00\x0e\x1b\x18\x18\x06\x18\x00\x01@\x00\x01`\x00\x00\x00`\x00\x00\x00\x00\x00\x00\x01\x00\x00\x01F\n\x00\x08\xc8\n\x00\x05\xe0\x00\x00\x00f\x00\x00\x00\xa2e\x9cG\x1de\x9cG\x1dZX\xc9\xd7\x00\x00\x03\x15\x00\x00\xff\x97\n\x00\x00\xf2\x10\x10\x06\x18\x00\x00@\x00\x01`\x00\x00\x00`\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00p\n\x00\x1d.\n\x00\x0f&\x00\x00\x00K\x00\x00\x00\x9ee\x9cG\x1de\x9c@\xea\x01\xbb\xcc\x8c\x00\x00;A\x00\x00\xfb\xf2\n\x00\x0e\x1b\x18\x18\x06\x12\x00\x01@\x00\x01`\x00\x00\x00`\x00\x00\x00\x00\x00\x00'
11
+
12
+ host = 'host02'
13
+ port = 2055
14
+ N = 10000
15
+
16
+ sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
17
+ sock.sendto(tpl, (host, port))
18
+ time.sleep(0.2)
19
+
20
+
21
+ print("%d: started sending %d Cisco ASR 9000 flows in %d packets totaling %d bytes" % (time.time(),N*21, N, N*len(data)))
22
+ for i in range(0, N):
23
+ sock.sendto(data, (host, port))
@@ -1860,6 +1860,118 @@ describe LogStash::Codecs::Netflow do
1860
1860
 
1861
1861
  end
1862
1862
 
1863
+
1864
+ context "Netflow 9 Huawei Netstream" do
1865
+ let(:data) do
1866
+ packets = []
1867
+ packets << IO.read(File.join(File.dirname(__FILE__), "netflow9_test_huawei_netstream_tpl.dat"), :mode => "rb")
1868
+ packets << IO.read(File.join(File.dirname(__FILE__), "netflow9_test_huawei_netstream_data.dat"), :mode => "rb")
1869
+ end
1870
+
1871
+ let(:json_events) do
1872
+ events = []
1873
+ events << <<-END
1874
+ {
1875
+ "@version": "1",
1876
+ "netflow": {
1877
+ "dst_as": 0,
1878
+ "rev_flow_delta_bytes": 0,
1879
+ "forwarding_status": {
1880
+ "reason": 0,
1881
+ "status": 0
1882
+ },
1883
+ "in_pkts": 4,
1884
+ "first_switched": "2018-01-29T02:56:52.999Z",
1885
+ "flowset_id": 1315,
1886
+ "ipv4_next_hop": "10.108.252.41",
1887
+ "l4_src_port": 45587,
1888
+ "src_vlan": 0,
1889
+ "in_bytes": 200,
1890
+ "protocol": 6,
1891
+ "tcp_flags": 24,
1892
+ "dst_vlan": 0,
1893
+ "l4_dst_port": 2598,
1894
+ "src_as": 0,
1895
+ "direction": 1,
1896
+ "output_snmp": 31,
1897
+ "dst_mask": 25,
1898
+ "ipv4_dst_addr": "10.111.112.204",
1899
+ "src_tos": 0,
1900
+ "src_mask": 24,
1901
+ "version": 9,
1902
+ "flow_seq_num": 129954,
1903
+ "ipv4_src_addr": "10.108.219.53",
1904
+ "last_switched": "2018-01-29T03:02:20.000Z",
1905
+ "input_snmp": 8,
1906
+ "bgp_ipv4_next_hop": "0.0.0.0"
1907
+ },
1908
+ "@timestamp": "2018-01-29T03:02:20.000Z"
1909
+ }
1910
+ END
1911
+ events.map{|event| event.gsub(/\s+/, "")}
1912
+ end
1913
+
1914
+ it "should decode raw data" do
1915
+ expect(decode.size).to eq(1)
1916
+ expect(decode[0].get("[netflow][rev_flow_delta_bytes]")).to eq(0)
1917
+ end
1918
+
1919
+ it "should serialize to json" do
1920
+ expect(JSON.parse(decode[0].to_json)).to eq(JSON.parse(json_events[0]))
1921
+ end
1922
+ end
1923
+
1924
+
1925
+ context "Netflow 9 field layer2segmentid" do
1926
+ let(:data) do
1927
+ packets = []
1928
+ packets << IO.read(File.join(File.dirname(__FILE__), "netflow9_test_field_layer2segmentid_tpl.dat"), :mode => "rb")
1929
+ packets << IO.read(File.join(File.dirname(__FILE__), "netflow9_test_field_layer2segmentid_data.dat"), :mode => "rb")
1930
+ end
1931
+
1932
+ let(:json_events) do
1933
+ events = []
1934
+ events << <<-END
1935
+ {
1936
+ "@version": "1",
1937
+ "netflow": {
1938
+ "in_pkts": 1,
1939
+ "ipv4_dst_addr": "80.82.237.40",
1940
+ "src_tos": 0,
1941
+ "first_switched": "2018-01-16T09:44:48.000Z",
1942
+ "flowset_id": 266,
1943
+ "l4_src_port": 61926,
1944
+ "version": 9,
1945
+ "flow_seq_num": 4773,
1946
+ "ipv4_src_addr": "192.168.200.136",
1947
+ "src_vlan": 3174,
1948
+ "protocol": 6,
1949
+ "in_bytes": 52,
1950
+ "input_snmp": 7,
1951
+ "last_switched": "2018-01-16T09:44:48.000Z",
1952
+ "flow_sampler_id": 98,
1953
+ "layer2SegmentId": 0,
1954
+ "ingressVRFID": 0,
1955
+ "l4_dst_port": 445,
1956
+ "direction": 0
1957
+ },
1958
+ "@timestamp": "2018-01-16T09:45:02.000Z"
1959
+ }
1960
+ END
1961
+ events.map{|event| event.gsub(/\s+/, "")}
1962
+ end
1963
+
1964
+ it "should decode raw data" do
1965
+ expect(decode.size).to eq(1)
1966
+ expect(decode[0].get("[netflow][layer2SegmentId]")).to eq(0)
1967
+ end
1968
+
1969
+ it "should serialize to json" do
1970
+ expect(JSON.parse(decode[0].to_json)).to eq(JSON.parse(json_events[0]))
1971
+ end
1972
+ end
1973
+
1974
+
1863
1975
  context "Netflow 9 Cisco ASR 9000 series template 260" do
1864
1976
  let(:data) do
1865
1977
  packets = []
metadata CHANGED
@@ -1,35 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-codec-netflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.10.0
4
+ version: 3.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-30 00:00:00.000000000 Z
11
+ date: 2018-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
- - - '>='
17
- - !ruby/object:Gem::Version
18
- version: '1.60'
19
- - - <=
16
+ - - ~>
20
17
  - !ruby/object:Gem::Version
21
- version: '2.99'
18
+ version: '2.0'
22
19
  name: logstash-core-plugin-api
23
20
  prerelease: false
24
21
  type: :runtime
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
- - - '>='
28
- - !ruby/object:Gem::Version
29
- version: '1.60'
30
- - - <=
24
+ - - ~>
31
25
  - !ruby/object:Gem::Version
32
- version: '2.99'
26
+ version: '2.0'
33
27
  - !ruby/object:Gem::Dependency
34
28
  requirement: !ruby/object:Gem::Requirement
35
29
  requirements:
@@ -128,9 +122,13 @@ files:
128
122
  - spec/codecs/netflow9_test_cisco_wlc_8510_tpl_262.dat
129
123
  - spec/codecs/netflow9_test_cisco_wlc_data261.dat
130
124
  - spec/codecs/netflow9_test_cisco_wlc_tpl.dat
125
+ - spec/codecs/netflow9_test_field_layer2segmentid_data.dat
126
+ - spec/codecs/netflow9_test_field_layer2segmentid_tpl.dat
131
127
  - spec/codecs/netflow9_test_fortigate_fortios_521_data256.dat
132
128
  - spec/codecs/netflow9_test_fortigate_fortios_521_data257.dat
133
129
  - spec/codecs/netflow9_test_fortigate_fortios_521_tpl.dat
130
+ - spec/codecs/netflow9_test_huawei_netstream_data.dat
131
+ - spec/codecs/netflow9_test_huawei_netstream_tpl.dat
134
132
  - spec/codecs/netflow9_test_invalid01.dat
135
133
  - spec/codecs/netflow9_test_juniper_srx_tplopt.dat
136
134
  - spec/codecs/netflow9_test_macaddr_data.dat
@@ -148,6 +146,8 @@ files:
148
146
  - spec/codecs/netflow9_test_ubnt_edgerouter_tpl.dat
149
147
  - spec/codecs/netflow9_test_unknown_tpl266_292_data.dat
150
148
  - spec/codecs/netflow9_test_valid01.dat
149
+ - spec/codecs/netflow_bench_cisco_asa.py
150
+ - spec/codecs/netflow_bench_cisco_asr.py
151
151
  - spec/codecs/netflow_spec.rb
152
152
  - spec/codecs/netflow_stress.py
153
153
  homepage: http://www.elastic.co/guide/en/logstash/current/index.html
@@ -226,9 +226,13 @@ test_files:
226
226
  - spec/codecs/netflow9_test_cisco_wlc_8510_tpl_262.dat
227
227
  - spec/codecs/netflow9_test_cisco_wlc_data261.dat
228
228
  - spec/codecs/netflow9_test_cisco_wlc_tpl.dat
229
+ - spec/codecs/netflow9_test_field_layer2segmentid_data.dat
230
+ - spec/codecs/netflow9_test_field_layer2segmentid_tpl.dat
229
231
  - spec/codecs/netflow9_test_fortigate_fortios_521_data256.dat
230
232
  - spec/codecs/netflow9_test_fortigate_fortios_521_data257.dat
231
233
  - spec/codecs/netflow9_test_fortigate_fortios_521_tpl.dat
234
+ - spec/codecs/netflow9_test_huawei_netstream_data.dat
235
+ - spec/codecs/netflow9_test_huawei_netstream_tpl.dat
232
236
  - spec/codecs/netflow9_test_invalid01.dat
233
237
  - spec/codecs/netflow9_test_juniper_srx_tplopt.dat
234
238
  - spec/codecs/netflow9_test_macaddr_data.dat
@@ -246,5 +250,7 @@ test_files:
246
250
  - spec/codecs/netflow9_test_ubnt_edgerouter_tpl.dat
247
251
  - spec/codecs/netflow9_test_unknown_tpl266_292_data.dat
248
252
  - spec/codecs/netflow9_test_valid01.dat
253
+ - spec/codecs/netflow_bench_cisco_asa.py
254
+ - spec/codecs/netflow_bench_cisco_asr.py
249
255
  - spec/codecs/netflow_spec.rb
250
256
  - spec/codecs/netflow_stress.py