logstash-filter-accesswatch 0.2.3 → 0.2.4

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
  SHA256:
3
- metadata.gz: cedc5dc69f6d2193285d7e153ef22ce7f3cb8c3aff03bbb5079f37c08d016b71
4
- data.tar.gz: ee8a7a72f282a9de6ad1a141749f42c7fe9c25c80109e0c052440b08f89d0e32
3
+ metadata.gz: 1004e11d9fb2b2eafe9d85ac69616c0583e575b496702a1e97a4f4938ee92b5c
4
+ data.tar.gz: 001a8b43fee61c5cbd1bc1781a32a47a53c6d477f23b63152dd2573308a3401c
5
5
  SHA512:
6
- metadata.gz: f5f0d92cf045ff741810168fafd6753077e47d3ce5399a986fd46521625338b94ddc123109d7377df208beb0377e115de29008ce609307c31f0f6beebe73b8c2
7
- data.tar.gz: 962d33aab0a947a1f6a1b08a9489f8d7324d17cd595d7c3b809c572210a989415d6c01c1e41596696c9233e69abad4d947aec43a505693abaa754bb7efcdb289
6
+ metadata.gz: 3a5ba9aaf22cda1af1cc61d567d1645b44296a90924ce39e988584e5e8688faa7c16e079d4f3c2e6d6de6ae735ba33e3ba1fe655deb8cdc243bac2d2a27b6ab7
7
+ data.tar.gz: ff2d92e7ff4c7d6e44cf3233e297b3d7a1f6db609613b4b7fd401f1bff56d1a2a780a7c333539c183dbdc4d72a5edd4f203820bad07cdf0ee1ec66dbdda7b992
data/cert.pem ADDED
@@ -0,0 +1,27 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIIEkjCCA3qgAwIBAgIQCgFBQgAAAVOFc2oLheynCDANBgkqhkiG9w0BAQsFADA/
3
+ MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT
4
+ DkRTVCBSb290IENBIFgzMB4XDTE2MDMxNzE2NDA0NloXDTIxMDMxNzE2NDA0Nlow
5
+ SjELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUxldCdzIEVuY3J5cHQ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BX7CVW+dla5cEilaUcne8IkCJLxWh9KEik3JHRRHGJo
22
+ uM2VcGfl96S8TihRzZvoroed6ti6WqEBmtzw3Wodatg+VyOeph4EYpr/1wXKtx8/
23
+ wApIvJSwtmVi4MFU5aMqrSDE6ea73Mj2tcMyo5jMd6jmeWUHK8so/joWUoHOUgwu
24
+ X4Po1QYz+3dszkDqMp4fklxBwXRsW10KXzPMTZ+sOPAveyxindmjkW8lGy+QsRlG
25
+ PfZ+G6Z6h7mjem0Y+iWlkYcV4PIWL1iwBi8saCbGS5jN2p8M+X+Q7UNKEkROb3N6
26
+ KOqkqm57TH2H3eDJAkSnh6/DNFu0Qg==
27
+ -----END CERTIFICATE-----
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  require "logstash/filters/base"
3
3
  require "logstash/namespace"
4
- require "logstash/plugin_mixins/http_client"
4
+ require 'manticore'
5
5
  require "json"
6
6
  require "digest"
7
7
  require "lru_redux"
@@ -11,8 +11,6 @@ require "lru_redux"
11
11
 
12
12
  class LogStash::Filters::Accesswatch < LogStash::Filters::Base
13
13
 
14
- include LogStash::PluginMixins::HttpClient
15
-
16
14
  config_name "accesswatch"
17
15
 
18
16
  # Your API Key
@@ -42,12 +40,16 @@ class LogStash::Filters::Accesswatch < LogStash::Filters::Base
42
40
  # The destination field for identity data
43
41
  config :identity_destination, :validate => :string
44
42
 
43
+ # Request timeout in seconds.
44
+ config :timeout, :validate => :number, :default => 1
45
+
45
46
  @@address_keys = ["value", "hostname", "country_code", "flags"]
46
47
  @@robot_keys = ["id", "name", "url"]
47
48
  @@identity_keys = ["type"]
48
49
 
49
50
  public
50
51
  def register
52
+ @client = Manticore::Client.new request_timeout: @timeout, ssl: {:ca_file => "cert.pem"}
51
53
  if @cache_size > 0
52
54
  @cache = LruRedux::ThreadSafeCache.new(@cache_size)
53
55
  end
@@ -63,26 +65,26 @@ class LogStash::Filters::Accesswatch < LogStash::Filters::Base
63
65
  end
64
66
 
65
67
  def url(path)
66
- "http://api.access.watch#{path}"
68
+ "https://api.access.watch#{path}"
67
69
  end
68
70
 
69
71
  def get_json(path)
70
72
  self.submit {
71
- self.client.get(self.url(path),
72
- headers: {"Api-Key" => @api_key,
73
- "Accept" => "application/json",
74
- "User-Agent" => "Access Watch Logstash Plugin/0.2.0"})
73
+ @client.get(self.url(path),
74
+ headers: {"Api-Key" => @api_key,
75
+ "Accept" => "application/json",
76
+ "User-Agent" => "Access Watch Logstash Plugin/0.2.0"})
75
77
  }
76
78
  end
77
79
 
78
80
  def post_json(path, data)
79
81
  self.submit {
80
- self.client.post(self.url(path),
81
- headers: {"Api-Key" => @api_key,
82
- "Accept" => "application/json",
83
- "Content-Type" => "application/json",
84
- "User-Agent" => "Access Watch Logstash Plugin/0.2.0"},
85
- body: JSON.generate(data))
82
+ @client.post(self.url(path),
83
+ headers: {"Api-Key" => @api_key,
84
+ "Accept" => "application/json",
85
+ "Content-Type" => "application/json",
86
+ "User-Agent" => "Access Watch Logstash Plugin/0.2.0"},
87
+ body: JSON.generate(data))
86
88
  }
87
89
  end
88
90
 
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
  Gem::Specification.new do |s|
3
3
  s.name = 'logstash-filter-accesswatch'
4
- s.version = '0.2.3'
4
+ s.version = '0.2.4'
5
5
  s.licenses = ['Apache-2.0']
6
6
  s.summary = 'The Logstash filter plugin for Access Watch (http://access.watch).'
7
7
  s.description = 'The Access Watch filter adds information about robots visiting your website based on data from our robot database.'
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
11
11
  s.require_paths = ['lib']
12
12
 
13
13
  # Files
14
- s.files = Dir['lib/**/*','spec/**/*','vendor/**/*','*.gemspec','*.md','Gemfile','LICENSE']
14
+ s.files = Dir['lib/**/*', 'cert.pem', '*.gemspec','*.md','Gemfile','LICENSE']
15
15
 
16
16
  # Special flag to let us know this is actually a logstash plugin
17
17
  s.metadata = { 'logstash_plugin' => 'true',
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
19
19
 
20
20
  # Gem dependencies
21
21
  s.add_runtime_dependency 'logstash-core-plugin-api', '~> 2.0'
22
- s.add_runtime_dependency 'logstash-mixin-http_client', '~> 5.2'
22
+ s.add_runtime_dependency 'manticore', '~> 0.6.1'
23
23
  s.add_runtime_dependency 'lru_redux', '~> 1.1'
24
24
 
25
25
  s.add_development_dependency 'logstash-devutils', '1.3.3'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-filter-accesswatch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benoît Fleury
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-20 00:00:00.000000000 Z
11
+ date: 2017-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -29,15 +29,15 @@ dependencies:
29
29
  requirements:
30
30
  - - "~>"
31
31
  - !ruby/object:Gem::Version
32
- version: '5.2'
33
- name: logstash-mixin-http_client
32
+ version: 0.6.1
33
+ name: manticore
34
34
  prerelease: false
35
35
  type: :runtime
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '5.2'
40
+ version: 0.6.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  requirement: !ruby/object:Gem::Requirement
43
43
  requirements:
@@ -77,6 +77,7 @@ files:
77
77
  - Gemfile
78
78
  - LICENSE
79
79
  - README.md
80
+ - cert.pem
80
81
  - lib/logstash/filters/accesswatch.rb
81
82
  - logstash-filter-accesswatch.gemspec
82
83
  homepage: http://access.watch