logstash-filter-tld 2.0.4 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/LICENSE +1 -1
- data/README.md +12 -3
- data/lib/logstash/filters/tld.rb +9 -9
- data/logstash-filter-tld.gemspec +3 -3
- data/spec/filters/tld_spec.rb +15 -15
- metadata +13 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d17e310163163fec96ac396596150cd82e0a5fb8
|
4
|
+
data.tar.gz: 723fdf84c764b6fbb1269a66a0e548a6fd8a6d57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b374611182491b851d18dc4919b68129cb6272b7b466972fa72f1efc2c91055a5a7a97335d8383624355acc5c3da0f7dd575e183c203253fa373f8f887d3701
|
7
|
+
data.tar.gz: ead43c2fbe6964a373bdd65793a61271d0aacc6168ae4f90b06ebb21a3e69fc521492adec5b5dbb1106e167685bfbceed9f91235021bb6768db68b18973e0578
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
## 3.0.0
|
2
|
+
- Breaking: Updated plugin to use new Java Event APIs
|
3
|
+
- relax logstash-core-plugin-api constrains
|
4
|
+
- update .travis.yml
|
5
|
+
|
1
6
|
# 2.0.4
|
2
7
|
- Depend on logstash-core-plugin-api instead of logstash-core, removing the need to mass update plugins on major releases of logstash
|
3
8
|
# 2.0.3
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# Logstash Plugin
|
2
2
|
|
3
|
-
[![Build
|
4
|
-
Status](http://build-eu-00.elastic.co/view/LS%20Plugins/view/LS%20Filters/job/logstash-plugin-filter-tld-unit/badge/icon)](http://build-eu-00.elastic.co/view/LS%20Plugins/view/LS%20Filters/job/logstash-plugin-filter-tld-unit/)
|
3
|
+
[![Travis Build Status](https://travis-ci.org/logstash-plugins/logstash-filter-tld.svg)](https://travis-ci.org/logstash-plugins/logstash-filter-tld)
|
5
4
|
|
6
5
|
This is a plugin for [Logstash](https://github.com/elastic/logstash).
|
7
6
|
|
@@ -56,7 +55,12 @@ gem "logstash-filter-awesome", :path => "/your/local/logstash-filter-awesome"
|
|
56
55
|
```
|
57
56
|
- Install plugin
|
58
57
|
```sh
|
58
|
+
# Logstash 2.3 and higher
|
59
|
+
bin/logstash-plugin install --no-verify
|
60
|
+
|
61
|
+
# Prior to Logstash 2.3
|
59
62
|
bin/plugin install --no-verify
|
63
|
+
|
60
64
|
```
|
61
65
|
- Run Logstash with your plugin
|
62
66
|
```sh
|
@@ -74,7 +78,12 @@ gem build logstash-filter-awesome.gemspec
|
|
74
78
|
```
|
75
79
|
- Install the plugin from the Logstash home
|
76
80
|
```sh
|
77
|
-
|
81
|
+
# Logstash 2.3 and higher
|
82
|
+
bin/logstash-plugin install --no-verify
|
83
|
+
|
84
|
+
# Prior to Logstash 2.3
|
85
|
+
bin/plugin install --no-verify
|
86
|
+
|
78
87
|
```
|
79
88
|
- Start Logstash and proceed to test the plugin
|
80
89
|
|
data/lib/logstash/filters/tld.rb
CHANGED
@@ -18,7 +18,6 @@ class LogStash::Filters::Tld < LogStash::Filters::Base
|
|
18
18
|
# }
|
19
19
|
#
|
20
20
|
config_name "tld"
|
21
|
-
milestone 1
|
22
21
|
|
23
22
|
# The source field to parse
|
24
23
|
config :source, :validate => :string, :default => "message"
|
@@ -35,16 +34,17 @@ class LogStash::Filters::Tld < LogStash::Filters::Base
|
|
35
34
|
public
|
36
35
|
def filter(event)
|
37
36
|
|
38
|
-
if @source and PublicSuffix.valid?(event
|
39
|
-
domain = PublicSuffix.parse(event
|
37
|
+
if @source and PublicSuffix.valid?(event.get(@source))
|
38
|
+
domain = PublicSuffix.parse(event.get(@source))
|
40
39
|
# Replace the event message with our message as configured in the
|
41
40
|
# config file.
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
41
|
+
h = Hash.new
|
42
|
+
h['tld'] = domain.tld
|
43
|
+
h['sld'] = domain.sld
|
44
|
+
h['trd'] = domain.trd
|
45
|
+
h['domain'] = domain.domain
|
46
|
+
h['subdomain'] = domain.subdomain
|
47
|
+
event.set(@target, h)
|
48
48
|
|
49
49
|
# filter_matched should go in the last line of our successful code
|
50
50
|
filter_matched(event)
|
data/logstash-filter-tld.gemspec
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-filter-tld'
|
3
|
-
s.version = '
|
3
|
+
s.version = '3.0.0'
|
4
4
|
s.licenses = ['Apache License (2.0)']
|
5
5
|
s.summary = "This example filter replaces the contents of the message field with the specified value."
|
6
|
-
s.description
|
6
|
+
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"
|
7
7
|
s.authors = ["Elastic"]
|
8
8
|
s.email = 'info@elastic.co'
|
9
9
|
s.homepage = "http://www.elastic.co/guide/en/logstash/current/index.html"
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.metadata = { "logstash_plugin" => "true", "logstash_group" => "filter" }
|
19
19
|
|
20
20
|
# Gem dependencies
|
21
|
-
s.add_runtime_dependency "logstash-core-plugin-api", "
|
21
|
+
s.add_runtime_dependency "logstash-core-plugin-api", ">= 1.60", "<= 2.99"
|
22
22
|
s.add_runtime_dependency 'public_suffix', '=1.4.6'
|
23
23
|
|
24
24
|
s.add_development_dependency 'logstash-devutils'
|
data/spec/filters/tld_spec.rb
CHANGED
@@ -26,27 +26,27 @@ describe LogStash::Filters::Tld do
|
|
26
26
|
|
27
27
|
|
28
28
|
sample("message" => "google.com") do
|
29
|
-
insist { subject
|
30
|
-
insist { subject
|
31
|
-
insist { subject
|
32
|
-
insist { subject
|
33
|
-
insist { subject
|
29
|
+
insist { subject.get("tld")["tld"] } == "com"
|
30
|
+
insist { subject.get("tld")["sld"] } == "google"
|
31
|
+
insist { subject.get("tld")["trd"] } == nil
|
32
|
+
insist { subject.get("tld")["domain"] } == "google.com"
|
33
|
+
insist { subject.get("tld")["subdomain"] } == nil
|
34
34
|
end
|
35
35
|
|
36
36
|
sample("message" => "google.co.uk") do
|
37
|
-
insist { subject
|
38
|
-
insist { subject
|
39
|
-
insist { subject
|
40
|
-
insist { subject
|
41
|
-
insist { subject
|
37
|
+
insist { subject.get("tld")["tld"] } == "co.uk"
|
38
|
+
insist { subject.get("tld")["sld"] } == "google"
|
39
|
+
insist { subject.get("tld")["trd"] } == nil
|
40
|
+
insist { subject.get("tld")["domain"] } == "google.co.uk"
|
41
|
+
insist { subject.get("tld")["subdomain"] } == nil
|
42
42
|
end
|
43
43
|
|
44
44
|
sample("message" => "www.google.com") do
|
45
|
-
insist { subject
|
46
|
-
insist { subject
|
47
|
-
insist { subject
|
48
|
-
insist { subject
|
49
|
-
insist { subject
|
45
|
+
insist { subject.get("tld")["tld"] } == "com"
|
46
|
+
insist { subject.get("tld")["sld"] } == "google"
|
47
|
+
insist { subject.get("tld")["trd"] } == "www"
|
48
|
+
insist { subject.get("tld")["domain"] } == "google.com"
|
49
|
+
insist { subject.get("tld")["subdomain"] } == "www.google.com"
|
50
50
|
end
|
51
51
|
|
52
52
|
end
|
metadata
CHANGED
@@ -1,29 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-filter-tld
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-22 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
|
-
- - "
|
16
|
+
- - ">="
|
17
|
+
- !ruby/object:Gem::Version
|
18
|
+
version: '1.60'
|
19
|
+
- - "<="
|
17
20
|
- !ruby/object:Gem::Version
|
18
|
-
version: '
|
21
|
+
version: '2.99'
|
19
22
|
name: logstash-core-plugin-api
|
20
23
|
prerelease: false
|
21
24
|
type: :runtime
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.60'
|
30
|
+
- - "<="
|
25
31
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
32
|
+
version: '2.99'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
requirement: !ruby/object:Gem::Requirement
|
29
35
|
requirements:
|
@@ -52,7 +58,7 @@ dependencies:
|
|
52
58
|
- - ">="
|
53
59
|
- !ruby/object:Gem::Version
|
54
60
|
version: '0'
|
55
|
-
description: This gem is a
|
61
|
+
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
|
56
62
|
email: info@elastic.co
|
57
63
|
executables: []
|
58
64
|
extensions: []
|