logstash-filter-referer 0.1 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/logstash/filters/referer.rb +12 -10
- data/logstash-filter-referer.gemspec +5 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e1ceedb027895c2e0548c82e6a8de5567d630aa
|
4
|
+
data.tar.gz: ff5a4975a0840a2b00cc60d7e1bae07efa376b24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
#
|
8
|
-
|
9
|
-
#
|
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
|
-
#
|
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
|
-
#
|
20
|
-
#
|
19
|
+
# referer {
|
20
|
+
# source => "referer"
|
21
21
|
# }
|
22
22
|
# }
|
23
23
|
#
|
24
|
-
config_name
|
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::
|
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.
|
3
|
+
s.version = '0.2'
|
4
4
|
s.licenses = ['Apache License (2.0)']
|
5
|
-
s.summary = "
|
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',
|
14
|
-
|
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.
|
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-
|
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:
|
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
|