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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aeef7333db990195a41932ecc341a9e5d7de8a8f
4
- data.tar.gz: e29d9c3a49b3c7cc318c9b546744c32aaedb3a2e
3
+ metadata.gz: d17e310163163fec96ac396596150cd82e0a5fb8
4
+ data.tar.gz: 723fdf84c764b6fbb1269a66a0e548a6fd8a6d57
5
5
  SHA512:
6
- metadata.gz: 18a39a5240aeee9bffd52fb3d14e31fed746b70a389bc594ecebaff1e954e86fc82b271f045e4237740c1f711190450b2f6569ce15b8a8d37496613c5bb18480
7
- data.tar.gz: 1adb995ed7a350c85d9fa61bd4dc599d5da127dbfd2f0231aac040fcbd60d1769e9d0810159e531e2e9dee276eabcd26fb7912d4e7f5bfcb92b875165f656df9
6
+ metadata.gz: 9b374611182491b851d18dc4919b68129cb6272b7b466972fa72f1efc2c91055a5a7a97335d8383624355acc5c3da0f7dd575e183c203253fa373f8f887d3701
7
+ data.tar.gz: ead43c2fbe6964a373bdd65793a61271d0aacc6168ae4f90b06ebb21a3e69fc521492adec5b5dbb1106e167685bfbceed9f91235021bb6768db68b18973e0578
@@ -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
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012–2015 Elasticsearch <http://www.elastic.co>
1
+ Copyright (c) 2012–2016 Elasticsearch <http://www.elastic.co>
2
2
 
3
3
  Licensed under the Apache License, Version 2.0 (the "License");
4
4
  you may not use this file except in compliance with the License.
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
- bin/plugin install /your/local/plugin/logstash-filter-awesome.gem
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
 
@@ -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[@source])
39
- domain = PublicSuffix.parse(event[@source])
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
- event[@target] = Hash.new
43
- event[@target]['tld'] = domain.tld
44
- event[@target]['sld'] = domain.sld
45
- event[@target]['trd'] = domain.trd
46
- event[@target]['domain'] = domain.domain
47
- event[@target]['subdomain'] = domain.subdomain
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)
@@ -1,9 +1,9 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-filter-tld'
3
- s.version = '2.0.4'
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 = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program"
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", "~> 1.0"
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'
@@ -26,27 +26,27 @@ describe LogStash::Filters::Tld do
26
26
 
27
27
 
28
28
  sample("message" => "google.com") do
29
- insist { subject["tld"]["tld"] } == "com"
30
- insist { subject["tld"]["sld"] } == "google"
31
- insist { subject["tld"]["trd"] } == nil
32
- insist { subject["tld"]["domain"] } == "google.com"
33
- insist { subject["tld"]["subdomain"] } == nil
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["tld"]["tld"] } == "co.uk"
38
- insist { subject["tld"]["sld"] } == "google"
39
- insist { subject["tld"]["trd"] } == nil
40
- insist { subject["tld"]["domain"] } == "google.co.uk"
41
- insist { subject["tld"]["subdomain"] } == nil
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["tld"]["tld"] } == "com"
46
- insist { subject["tld"]["sld"] } == "google"
47
- insist { subject["tld"]["trd"] } == "www"
48
- insist { subject["tld"]["domain"] } == "google.com"
49
- insist { subject["tld"]["subdomain"] } == "www.google.com"
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: 2.0.4
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-03-24 00:00:00.000000000 Z
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: '1.0'
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: '1.0'
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 logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program
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: []