dap 0.1.18 → 0.1.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/dap/filter/udp.rb +11 -1
- data/lib/dap/input.rb +2 -3
- data/lib/dap/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8311c0f9e900cf884eff13a597b955673735c23e
|
4
|
+
data.tar.gz: d4431561b2ac5576b8ee42c1b794ede5839b5d84
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b0191b8e6c69c47288c192a112ac7b0abe530dd8934b02a40b71c89e9e37c38db81650048e0ed8fb56006f3793ee86ebff7fbb3cbb9a2b5f913a9ecef26eddc
|
7
|
+
data.tar.gz: 1e9e2c7dcba583ef779cf882d25b6c5314be9b2a7d05a5d58ed55b3b4e26fb48567efbdfb424371d189231ff5cc0324c1974a334efefed35028d870f1205bdd8
|
data/README.md
CHANGED
@@ -54,7 +54,7 @@ Uage: dap [input] + [filter] + [output]
|
|
54
54
|
|
55
55
|
To see which input/output formats are supported and what filters are available, run `dap --inputs`,`dap --outputs` or `dap --filters`, respectively.
|
56
56
|
|
57
|
-
This example reads as input a single IP address from `STDIN` in line form, applies geo-ip
|
57
|
+
This example reads as input a single IP address from `STDIN` in line form, applies geo-ip transformations as a filter on that line, and then returns the output as JSON:
|
58
58
|
|
59
59
|
```
|
60
60
|
$ echo 8.8.8.8 | bin/dap + lines + geo_ip line + json
|
data/lib/dap/filter/udp.rb
CHANGED
@@ -83,7 +83,17 @@ class FilterDecodeUPNP_SSDP_Reply
|
|
83
83
|
include BaseDecoder
|
84
84
|
def decode(data)
|
85
85
|
head = { }
|
86
|
-
data.split(/\n/)
|
86
|
+
lines = data.split(/\r?\n/)
|
87
|
+
return if lines.empty?
|
88
|
+
if /^HTTP\/\d+\.\d+\s+(?<http_code>\d+)(?:\s+(?<http_message>.*))?/ =~ lines.first
|
89
|
+
head["upnp_http_code"] = http_code
|
90
|
+
head["upnp_http_message"] = http_message
|
91
|
+
else
|
92
|
+
return
|
93
|
+
end
|
94
|
+
|
95
|
+
lines.shift
|
96
|
+
lines.each do |line|
|
87
97
|
k,v = line.strip.split(':', 2)
|
88
98
|
next if not k
|
89
99
|
head["upnp_#{k.downcase}"] = (v.to_s.strip)
|
data/lib/dap/input.rb
CHANGED
@@ -64,8 +64,7 @@ module Input
|
|
64
64
|
begin
|
65
65
|
json = Oj.load(line.strip, mode: :strict)
|
66
66
|
rescue
|
67
|
-
$stderr.puts "
|
68
|
-
$stderr.puts line
|
67
|
+
$stderr.puts "Record is not valid JSON and will be skipped: '#{line}'"
|
69
68
|
return Error::InvalidFormat
|
70
69
|
end
|
71
70
|
return Error::Empty unless json
|
@@ -78,4 +77,4 @@ end
|
|
78
77
|
end
|
79
78
|
|
80
79
|
require 'dap/input/warc'
|
81
|
-
require 'dap/input/csv'
|
80
|
+
require 'dap/input/csv'
|
data/lib/dap/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rapid7 Research
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -253,7 +253,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
253
253
|
version: '0'
|
254
254
|
requirements: []
|
255
255
|
rubyforge_project:
|
256
|
-
rubygems_version: 2.
|
256
|
+
rubygems_version: 2.6.11
|
257
257
|
signing_key:
|
258
258
|
specification_version: 4
|
259
259
|
summary: 'DAP: The Data Analysis Pipeline'
|