logstash-filter-sumo 3.0.11 → 3.0.12
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 +4 -4
- data/README.md +10 -68
- data/lib/logstash/filters/sumo.rb +7 -13
- data/logstash-filter-sumo.gemspec +2 -2
- metadata +10 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c9f3040d64766b857ddca0636a1514e817f10da
|
4
|
+
data.tar.gz: e8ee47555b3d13328f0c0fd2e7d250b68cc86c70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bcc703ea147f4f191fe053d67be9d257a40fa655e59ffbb629b612c28e91b744881e3ca0b78bbcd26a2f4bc0aea8ad38e6c9db8e0901b894d8e5f365a6b099fe
|
7
|
+
data.tar.gz: c68194a1f3691542f1e685203048118f308a8814ea9c5bfa7739a96e6506b6c09d65655dcb8c0ceaba871ce5a20150f6d3bb83e5169af94f9ea4181da66804f7
|
data/README.md
CHANGED
@@ -1,78 +1,20 @@
|
|
1
|
-
# Logstash Plugin
|
1
|
+
# SUMO Logstash Plugin
|
2
2
|
|
3
|
-
|
4
|
-
Status](http://build-eu-00.elastic.co/view/LS%20Plugins/view/LS%20Filters/job/logstash-plugin-filter-example-unit/badge/icon)](http://build-eu-00.elastic.co/view/LS%20Plugins/view/LS%20Filters/job/logstash-plugin-filter-example-unit/)
|
3
|
+
Filters sumo access log lines and extracts useful information.
|
5
4
|
|
6
|
-
This
|
5
|
+
This projects needs jruby, so use "rvm use jruby". Tested and deployed with jruby 9.0.4.0
|
7
6
|
|
8
|
-
|
7
|
+
# Versions
|
8
|
+
3.0.12 Updated ismvod to cover all types starting with ismvod
|
9
9
|
|
10
|
-
## Developing
|
11
10
|
|
12
|
-
|
11
|
+
## Build
|
12
|
+
Update the version numder in logstash-filter-sumo.gemspec
|
13
|
+
Update readme with new release information
|
14
|
+
gem build logstash-filter-sumo.gemspec
|
13
15
|
|
14
|
-
#### Code
|
15
|
-
- To get started, you'll need JRuby with the Bundler gem installed.
|
16
16
|
|
17
|
-
- Create a new plugin or clone and existing from the GitHub [logstash-plugins](https://github.com/logstash-plugins) organization. We also provide [example plugins](https://github.com/logstash-plugins?query=example).
|
18
17
|
|
19
|
-
|
20
|
-
```sh
|
21
|
-
bundle install
|
22
|
-
```
|
18
|
+
Author : Leif Terje Fonnes ( leffen@gmail.com )
|
23
19
|
|
24
|
-
#### Test
|
25
20
|
|
26
|
-
- Update your dependencies
|
27
|
-
|
28
|
-
```sh
|
29
|
-
bundle install
|
30
|
-
```
|
31
|
-
|
32
|
-
- Run tests
|
33
|
-
|
34
|
-
```sh
|
35
|
-
bundle exec rspec
|
36
|
-
```
|
37
|
-
|
38
|
-
### 2. Running your unpublished Plugin in Logstash
|
39
|
-
|
40
|
-
#### 2.1 Run in a local Logstash clone
|
41
|
-
|
42
|
-
- Edit Logstash `Gemfile` and add the local plugin path, for example:
|
43
|
-
```ruby
|
44
|
-
gem "logstash-filter-awesome", :path => "/your/local/logstash-filter-awesome"
|
45
|
-
```
|
46
|
-
- Install plugin
|
47
|
-
```sh
|
48
|
-
bin/plugin install --no-verify
|
49
|
-
```
|
50
|
-
- Run Logstash with your plugin
|
51
|
-
```sh
|
52
|
-
bin/logstash -e 'filter {awesome {}}'
|
53
|
-
```
|
54
|
-
At this point any modifications to the plugin code will be applied to this local Logstash setup. After modifying the plugin, simply rerun Logstash.
|
55
|
-
|
56
|
-
#### 2.2 Run in an installed Logstash
|
57
|
-
|
58
|
-
You can use the same **2.1** method to run your plugin in an installed Logstash by editing its `Gemfile` and pointing the `:path` to your local plugin development directory or you can build the gem and install it using:
|
59
|
-
|
60
|
-
- Build your plugin gem
|
61
|
-
```sh
|
62
|
-
gem build logstash-filter-awesome.gemspec
|
63
|
-
```
|
64
|
-
- Install the plugin from the Logstash home
|
65
|
-
```sh
|
66
|
-
bin/plugin install /your/local/plugin/logstash-filter-awesome.gem
|
67
|
-
```
|
68
|
-
- Start Logstash and proceed to test the plugin
|
69
|
-
|
70
|
-
## Contributing
|
71
|
-
|
72
|
-
All contributions are welcome: ideas, patches, documentation, bug reports, complaints, and even something you drew up on a napkin.
|
73
|
-
|
74
|
-
Programming is not a required skill. Whatever you've seen about open source and maintainers or community members saying "send patches or die" - you will not see that here.
|
75
|
-
|
76
|
-
It is more important to the community that you are able to contribute.
|
77
|
-
|
78
|
-
For more information about contributing, see the [CONTRIBUTING](https://github.com/elastic/logstash/blob/master/CONTRIBUTING.md) file.
|
@@ -32,11 +32,9 @@ class LogStash::Filters::Sumo < LogStash::Filters::Base
|
|
32
32
|
last_seg = uarray.last.split(".")
|
33
33
|
video_type = last_seg.last
|
34
34
|
|
35
|
-
#,video_type: video_type, asset_id: asset_id,chunk_type: chunk_type
|
36
35
|
{path_type: "vod2", dist_type: "vod", video_type: video_type, asset_id: asset_id}
|
37
36
|
end
|
38
37
|
|
39
|
-
# /ismusp/2013-10-22/N_RYANAIR_221013_TOB_NET(763009_R22MP41000).mp4
|
40
38
|
def ismusp_parse uarray
|
41
39
|
last_seg = uarray.last.split(".")
|
42
40
|
asset_id = last_seg[0].split("(")[1].split("_").first.to_i
|
@@ -45,8 +43,6 @@ class LogStash::Filters::Sumo < LogStash::Filters::Base
|
|
45
43
|
{path_type: "ismusp", dist_type: "vod", video_type: video_type, asset_id: asset_id}
|
46
44
|
end
|
47
45
|
|
48
|
-
|
49
|
-
# /ismusp/2013-10-22/N_RYANAIR_221013_TOB_NET(763009_R22MP41000).mp4
|
50
46
|
def ismvod_parse uarray
|
51
47
|
last_seg = uarray.last.split(".")
|
52
48
|
asset_id = uarray[3].split(":")[1].split(".").first.to_i
|
@@ -55,8 +51,6 @@ class LogStash::Filters::Sumo < LogStash::Filters::Base
|
|
55
51
|
{path_type: "ismvod", dist_type: "vod", video_type: video_type, asset_id: asset_id}
|
56
52
|
end
|
57
53
|
|
58
|
-
# /coraid_ism_1/2015-06-11/Bloggerne_4_(924507_ISM).ism/Manifest
|
59
|
-
# /netapp_ism_10/2015-04-01/R_BLOGGERNE4_EP25_G02371(902135_R283ISMH).ism/Manifest
|
60
54
|
def ism_parse uarray
|
61
55
|
page_type = uarray.pop.split(".")
|
62
56
|
page_info = uarray.pop
|
@@ -70,6 +64,7 @@ class LogStash::Filters::Sumo < LogStash::Filters::Base
|
|
70
64
|
uri = URI.parse(page)
|
71
65
|
uarray = uri.path.split("/")
|
72
66
|
page_type = uarray[-2]
|
67
|
+
|
73
68
|
return {} unless page_type && uarray.count > 0
|
74
69
|
|
75
70
|
if uarray[1] == 'wzlive'
|
@@ -80,7 +75,7 @@ class LogStash::Filters::Sumo < LogStash::Filters::Base
|
|
80
75
|
vod2_parse(uarray)
|
81
76
|
elsif uarray[1] == 'ismusp'
|
82
77
|
ismusp_parse(uarray)
|
83
|
-
elsif uarray[1]
|
78
|
+
elsif uarray[1].to_s.include?('ismvod')
|
84
79
|
ismvod_parse(uarray)
|
85
80
|
elsif page_type.to_s.include?(".ism")
|
86
81
|
ism_parse(uarray)
|
@@ -101,12 +96,11 @@ class LogStash::Filters::Sumo < LogStash::Filters::Base
|
|
101
96
|
def filter(event)
|
102
97
|
if @field && event[@field]
|
103
98
|
begin
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
rescue
|
108
|
-
@logger.error("SUMO> "
|
109
|
-
|
99
|
+
data = parse_page(event[@field])
|
100
|
+
data.each { |k, v| event[k.to_s]=v }
|
101
|
+
@logger.debug("SUMO> ", :pg => event[@field], :data => data)
|
102
|
+
rescue => e
|
103
|
+
@logger.error("SUMO> ", :pg => event[@field], :exception => e)
|
110
104
|
end
|
111
105
|
|
112
106
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-filter-sumo'
|
3
|
-
s.version = '3.0.
|
3
|
+
s.version = '3.0.12'
|
4
4
|
s.licenses = ['Apache License (2.0)']
|
5
5
|
s.summary = "This filter extracts interessting SUMO values from the page element if present."
|
6
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"
|
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
|
|
20
20
|
|
21
21
|
# Gem dependencies
|
22
22
|
s.add_runtime_dependency "logstash-core", ">= 2.0.0", "< 3.0.0"
|
23
|
-
s.add_development_dependency 'logstash-devutils'
|
23
|
+
s.add_development_dependency 'logstash-devutils', '~> 0.0', '>= 0.0.8'
|
24
24
|
s.add_development_dependency 'rspec', '~> 2.7'
|
25
25
|
|
26
26
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-filter-sumo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TV 2
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-04-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -34,17 +34,23 @@ dependencies:
|
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0.0'
|
37
40
|
- - ">="
|
38
41
|
- !ruby/object:Gem::Version
|
39
|
-
version:
|
42
|
+
version: 0.0.8
|
40
43
|
name: logstash-devutils
|
41
44
|
prerelease: false
|
42
45
|
type: :development
|
43
46
|
version_requirements: !ruby/object:Gem::Requirement
|
44
47
|
requirements:
|
48
|
+
- - "~>"
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '0.0'
|
45
51
|
- - ">="
|
46
52
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
53
|
+
version: 0.0.8
|
48
54
|
- !ruby/object:Gem::Dependency
|
49
55
|
requirement: !ruby/object:Gem::Requirement
|
50
56
|
requirements:
|