logstash-filter-wkt_to_geojson 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54e0ecc2235b086ff5bb7a606a68a07f03ffe2a7
|
4
|
+
data.tar.gz: ede97773acfe9feec0364ea5703ef6e866adee28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79a103a7260a1cdb0158f938abc01085bf0178a95c5d2a6665d11921b9fc20e71139886a2da8e07ede69767ee6a305ca9703d291263890e9d07ccf7d4b830850
|
7
|
+
data.tar.gz: 2b9f3b05c9bb0e814712c8b264cc19f62fb9af236224bf548ff9eb614857479c6abb40f70931bac6bd2ef463799d63535513b538662e70565805e9a3651034c6
|
@@ -9,9 +9,9 @@ class LogStash::Filters::WktToGeojson < LogStash::Filters::Base
|
|
9
9
|
|
10
10
|
config_name "wkt_to_geojson"
|
11
11
|
|
12
|
-
config :
|
12
|
+
config :source, :validate => :string, :required => true
|
13
13
|
config :target, :validate => :string, :default => 'geo_json'
|
14
|
-
config :
|
14
|
+
config :tag_on_failure, :validate => :array, :default => [ '_wkt_parse_failure' ]
|
15
15
|
|
16
16
|
public
|
17
17
|
def register
|
@@ -20,7 +20,7 @@ class LogStash::Filters::WktToGeojson < LogStash::Filters::Base
|
|
20
20
|
public
|
21
21
|
def filter(event)
|
22
22
|
|
23
|
-
wkt = event.get(@
|
23
|
+
wkt = event.get(@source)
|
24
24
|
|
25
25
|
begin
|
26
26
|
factory = GeoRuby::SimpleFeatures::GeometryFactory::new()
|
@@ -36,7 +36,7 @@ class LogStash::Filters::WktToGeojson < LogStash::Filters::Base
|
|
36
36
|
rescue Exception => e
|
37
37
|
@logger.error('WKT Parse Error',
|
38
38
|
:wkt => wkt, :exception => e)
|
39
|
-
@
|
39
|
+
@tag_on_failure.each { |tag| event.tag(tag) }
|
40
40
|
end
|
41
41
|
|
42
42
|
# filter_matched should go in the last line of our successful code
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-filter-wkt_to_geojson'
|
3
|
-
s.version = '0.1.
|
3
|
+
s.version = '0.1.3'
|
4
4
|
s.licenses = ['Apache-2.0']
|
5
5
|
s.summary = 'Logstash filter to convert WKT geography shapes to GeoJSON.'
|
6
6
|
s.homepage = 'https://github.com/kalmas/logstash-filter-wkt_to_geojson'
|
@@ -7,7 +7,7 @@ describe LogStash::Filters::WktToGeojson do
|
|
7
7
|
let(:config) do <<-CONFIG
|
8
8
|
filter {
|
9
9
|
wkt_to_geojson {
|
10
|
-
|
10
|
+
source => "geometry"
|
11
11
|
}
|
12
12
|
}
|
13
13
|
CONFIG
|
@@ -22,7 +22,7 @@ describe LogStash::Filters::WktToGeojson do
|
|
22
22
|
let(:config) do <<-CONFIG
|
23
23
|
filter {
|
24
24
|
wkt_to_geojson {
|
25
|
-
|
25
|
+
source => "geometry"
|
26
26
|
target => "geoff_jason"
|
27
27
|
}
|
28
28
|
}
|
@@ -39,7 +39,7 @@ describe LogStash::Filters::WktToGeojson do
|
|
39
39
|
let(:config) do <<-CONFIG
|
40
40
|
filter {
|
41
41
|
wkt_to_geojson {
|
42
|
-
|
42
|
+
source => "geometry"
|
43
43
|
}
|
44
44
|
}
|
45
45
|
CONFIG
|
@@ -56,8 +56,8 @@ describe LogStash::Filters::WktToGeojson do
|
|
56
56
|
let(:config) do <<-CONFIG
|
57
57
|
filter {
|
58
58
|
wkt_to_geojson {
|
59
|
-
|
60
|
-
|
59
|
+
source => "geometry"
|
60
|
+
tag_on_failure => [ "oppsie" ]
|
61
61
|
}
|
62
62
|
}
|
63
63
|
CONFIG
|
@@ -74,7 +74,7 @@ describe LogStash::Filters::WktToGeojson do
|
|
74
74
|
let(:config) do <<-CONFIG
|
75
75
|
filter {
|
76
76
|
wkt_to_geojson {
|
77
|
-
|
77
|
+
source => "not_a_field"
|
78
78
|
}
|
79
79
|
}
|
80
80
|
CONFIG
|