logstash-filter-referer 0.1 → 0.2

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: c421bddc502b8831907b2acf41c045682947b81c
4
- data.tar.gz: b1ed44a30d985e152b226ab82cb2590d67ea0882
3
+ metadata.gz: 2e1ceedb027895c2e0548c82e6a8de5567d630aa
4
+ data.tar.gz: ff5a4975a0840a2b00cc60d7e1bae07efa376b24
5
5
  SHA512:
6
- metadata.gz: fc699d638e7605dfbe87b01b5777e1452112494fa2c0590d269c6880b2774b4712ea57f5224fc1fca38385eed0b16383253905772cfe5496da0d7b5cee79dbbd
7
- data.tar.gz: 26fdac634255b3472686dd23f452c0964cc40683fb49946e0f123a2fdf0df4f4ffc2f58de84d9618b7eba7d1fa3b12531a6b33a6552adeac37e3ffac3efcfb9b
6
+ metadata.gz: d3b10591b69824df9077515b5aaa80cf07a5ea60e37b599dbf6295c3695a015c3d866376c9560e1e0cf4d2ce396cd180422236652d66d8b05f883e0cc727e247
7
+ data.tar.gz: 075cb3a81df2e85b248f9363a613538540150619cce8db45fa989dce620cfd6fb621467b2845fcb6754c8d8acc9f135c1de5081d96fcfe079852a38d55d4e288
@@ -4,31 +4,33 @@ require "logstash/namespace"
4
4
  require "yaml"
5
5
  require "uri"
6
6
 
7
- # https://github.com/piwik/searchengine-and-social-list
8
-
9
- # This example filter will replace the contents of the default
10
- # message field with whatever you specify in the configuration.
7
+ # Referer plugin get information from the referer field in http logs.
8
+ # This plugin can tell if a website is "social" or "search engine".
9
+ # For Search engine, the query is extracted.
11
10
  #
12
- # It is only intended to be used as an example.
11
+ # Patterns came from the Piwik project :
12
+ # see <https://github.com/piwik/searchengine-and-social-list>
13
13
  class LogStash::Filters::Referer < LogStash::Filters::Base
14
14
 
15
15
  # Setting the config_name here is required. This is how you
16
16
  # configure this filter from your Logstash config.
17
17
  #
18
18
  # filter {
19
- # example {
20
- # message => "My message..."
19
+ # referer {
20
+ # source => "referer"
21
21
  # }
22
22
  # }
23
23
  #
24
- config_name "referer"
24
+ config_name 'referer'
25
25
 
26
+ # The field containing the referer url
26
27
  config :source, :validate => :string, :required => true
28
+
29
+ # Specify the field into which Logstash should store the referer data.
27
30
  config :target, :validate => :string, :default => 'referer'
28
31
 
29
32
  public
30
33
  def register
31
- # Add instance variables
32
34
  path = ::File.expand_path('../../../vendor/Socials.yml', ::File.dirname(__FILE__))
33
35
  @social = Hash.new
34
36
  YAML.load(File.open(path, 'r').read).each do |key, values|
@@ -109,4 +111,4 @@ class LogStash::Filters::Referer < LogStash::Filters::Base
109
111
  # filter_matched should go in the last line of our successful code
110
112
  filter_matched(event)
111
113
  end # def filter
112
- end # class LogStash::Filters::Example
114
+ end # class LogStash::Filters::Referer
@@ -1,8 +1,8 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-filter-referer'
3
- s.version = '0.1'
3
+ s.version = '0.2'
4
4
  s.licenses = ['Apache License (2.0)']
5
- s.summary = "Build information about referer"
5
+ s.summary = "Logstash plugin for getting information from http referer"
6
6
  s.description = ""
7
7
  s.authors = ["athoune"]
8
8
  s.email = 'mathieu@garambrogne.net'
@@ -10,8 +10,9 @@ Gem::Specification.new do |s|
10
10
  s.require_paths = ["lib"]
11
11
 
12
12
  # Files
13
- s.files = Dir['lib/**/*','spec/**/*','vendor/**/*','*.gemspec','*.md','CONTRIBUTORS','Gemfile','LICENSE','NOTICE.TXT']
14
- # Tests
13
+ s.files = Dir['lib/**/*','spec/**/*','vendor/**/*','*.gemspec','*.md',
14
+ 'CONTRIBUTORS','Gemfile','LICENSE','NOTICE.TXT']
15
+ # Tests
15
16
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
16
17
 
17
18
  # Special flag to let us know this is actually a logstash plugin
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-filter-referer
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: '0.2'
5
5
  platform: ruby
6
6
  authors:
7
7
  - athoune
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-04 00:00:00.000000000 Z
11
+ date: 2015-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -88,7 +88,7 @@ rubyforge_project:
88
88
  rubygems_version: 2.4.5
89
89
  signing_key:
90
90
  specification_version: 4
91
- summary: Build information about referer
91
+ summary: Logstash plugin for getting information from http referer
92
92
  test_files:
93
93
  - spec/filters/referer_spec.rb
94
94
  - spec/spec_helper.rb