logstash-filter-grok 0.1.5 → 0.1.7
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/Gemfile +1 -2
- data/README.md +12 -21
- data/logstash-filter-grok.gemspec +2 -3
- data/spec/filters/grok_spec.rb +10 -4
- data/spec/spec_helper.rb +5 -0
- metadata +5 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c7ef85c71db3e508eb52f05c8b9afd92b321f0d
|
4
|
+
data.tar.gz: bceaff9b624ba2697491b96b1f09d83b9b376b74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51bcb3bd43ba61c78ca4754407fd48828896209e47728174ced3f03aa76bb351bc1b42c032a03c3d7dc6e8219daaf8f2c47b6226876f68e61a8a8e0fdfed2ee9
|
7
|
+
data.tar.gz: 62f1efb38df078c7b529b06146a0cdc2a5c8508ee29f1b2dbb365643aa4e737d3fc9c20d56fbcfca69a184fb7d86f13aa075bbaae0f79eab9787caeb052cd515
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -22,7 +22,7 @@ Need help? Try #logstash on freenode IRC or the logstash-users@googlegroups.com
|
|
22
22
|
#### Code
|
23
23
|
- To get started, you'll need JRuby with the Bundler gem installed.
|
24
24
|
|
25
|
-
- Create a new plugin or clone and existing from the GitHub [logstash-plugins](https://github.com/logstash-plugins) organization.
|
25
|
+
- 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).
|
26
26
|
|
27
27
|
- Install dependencies
|
28
28
|
```sh
|
@@ -31,26 +31,15 @@ bundle install
|
|
31
31
|
|
32
32
|
#### Test
|
33
33
|
|
34
|
-
|
35
|
-
bundle exec rspec
|
36
|
-
```
|
34
|
+
- Update your dependencies
|
37
35
|
|
38
|
-
|
39
|
-
|
40
|
-
gem "logstash", :github => "elasticsearch/logstash", :branch => "1.5"
|
41
|
-
```
|
42
|
-
To test against another version or a local Logstash, edit the `Gemfile` to specify an alternative location, for example:
|
43
|
-
```ruby
|
44
|
-
gem "logstash", :github => "elasticsearch/logstash", :ref => "master"
|
45
|
-
```
|
46
|
-
```ruby
|
47
|
-
gem "logstash", :path => "/your/local/logstash"
|
36
|
+
```sh
|
37
|
+
bundle install
|
48
38
|
```
|
49
39
|
|
50
|
-
|
40
|
+
- Run tests
|
51
41
|
|
52
42
|
```sh
|
53
|
-
bundle install
|
54
43
|
bundle exec rspec
|
55
44
|
```
|
56
45
|
|
@@ -58,13 +47,13 @@ bundle exec rspec
|
|
58
47
|
|
59
48
|
#### 2.1 Run in a local Logstash clone
|
60
49
|
|
61
|
-
- Edit Logstash `
|
50
|
+
- Edit Logstash `Gemfile` and add the local plugin path, for example:
|
62
51
|
```ruby
|
63
52
|
gem "logstash-filter-awesome", :path => "/your/local/logstash-filter-awesome"
|
64
53
|
```
|
65
|
-
-
|
54
|
+
- Install plugin
|
66
55
|
```sh
|
67
|
-
|
56
|
+
bin/plugin install --no-verify
|
68
57
|
```
|
69
58
|
- Run Logstash with your plugin
|
70
59
|
```sh
|
@@ -74,6 +63,8 @@ At this point any modifications to the plugin code will be applied to this local
|
|
74
63
|
|
75
64
|
#### 2.2 Run in an installed Logstash
|
76
65
|
|
66
|
+
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:
|
67
|
+
|
77
68
|
- Build your plugin gem
|
78
69
|
```sh
|
79
70
|
gem build logstash-filter-awesome.gemspec
|
@@ -90,6 +81,6 @@ All contributions are welcome: ideas, patches, documentation, bug reports, compl
|
|
90
81
|
|
91
82
|
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.
|
92
83
|
|
93
|
-
It is more important to
|
84
|
+
It is more important to the community that you are able to contribute.
|
94
85
|
|
95
|
-
For more information about contributing, see the [CONTRIBUTING](https://github.com/elasticsearch/logstash/blob/master/CONTRIBUTING.md) file.
|
86
|
+
For more information about contributing, see the [CONTRIBUTING](https://github.com/elasticsearch/logstash/blob/master/CONTRIBUTING.md) file.
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-filter-grok'
|
4
|
-
s.version = '0.1.
|
4
|
+
s.version = '0.1.7'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "Parse arbitrary text and structure it."
|
7
7
|
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,11 +20,10 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.metadata = { "logstash_plugin" => "true", "logstash_group" => "filter" }
|
21
21
|
|
22
22
|
# Gem dependencies
|
23
|
-
s.add_runtime_dependency
|
23
|
+
s.add_runtime_dependency "logstash-core", '>= 1.4.0', '< 2.0.0'
|
24
24
|
|
25
25
|
s.add_runtime_dependency 'jls-grok', '~> 0.11.1'
|
26
26
|
s.add_runtime_dependency 'logstash-patterns-core'
|
27
|
-
s.add_development_dependency 'logstash-devutils'
|
28
27
|
|
29
28
|
s.add_development_dependency 'logstash-devutils'
|
30
29
|
end
|
data/spec/filters/grok_spec.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
require
|
3
|
-
require "logstash/filters/grok"
|
2
|
+
require 'spec_helper'
|
4
3
|
|
5
4
|
describe LogStash::Filters::Grok do
|
6
5
|
|
@@ -648,8 +647,11 @@ describe LogStash::Filters::Grok do
|
|
648
647
|
require 'tmpdir'
|
649
648
|
require 'tempfile'
|
650
649
|
|
650
|
+
let(:pattern_dir) { File.join(LogStash::Environment::LOGSTASH_HOME, "patterns") }
|
651
|
+
let(:has_pattern_dir?) { Dir.exist?(pattern_dir) }
|
652
|
+
|
651
653
|
before do
|
652
|
-
pattern_dir
|
654
|
+
FileUtils.mkdir(pattern_dir) unless has_pattern_dir?
|
653
655
|
@file = Tempfile.new('grok', pattern_dir);
|
654
656
|
@file.write('WORD \b[2-5]\b')
|
655
657
|
@file.close
|
@@ -665,6 +667,7 @@ describe LogStash::Filters::Grok do
|
|
665
667
|
|
666
668
|
after do
|
667
669
|
@file.unlink
|
670
|
+
FileUtils.rm_rf(pattern_dir) if has_pattern_dir?
|
668
671
|
end
|
669
672
|
end
|
670
673
|
|
@@ -673,9 +676,11 @@ describe LogStash::Filters::Grok do
|
|
673
676
|
require 'tempfile'
|
674
677
|
|
675
678
|
let(:tmpdir) { Dir.mktmpdir }
|
679
|
+
let(:pattern_dir) { File.join(LogStash::Environment::LOGSTASH_HOME, "patterns") }
|
680
|
+
let(:has_pattern_dir?) { Dir.exist?(pattern_dir) }
|
676
681
|
|
677
682
|
before do
|
678
|
-
pattern_dir
|
683
|
+
FileUtils.mkdir(pattern_dir) unless has_pattern_dir?
|
679
684
|
@file1 = Tempfile.new('grok', pattern_dir); @file1.write('WORD \b[2-5]\b'); @file1.close
|
680
685
|
@file2 = Tempfile.new('grok', tmpdir); @file2.write('WORD \b[0-1]\b'); @file2.close
|
681
686
|
end
|
@@ -692,6 +697,7 @@ describe LogStash::Filters::Grok do
|
|
692
697
|
@file1.unlink
|
693
698
|
@file2.unlink
|
694
699
|
FileUtils.remove_entry tmpdir
|
700
|
+
FileUtils.rm_rf(pattern_dir) unless has_pattern_dir?
|
695
701
|
end
|
696
702
|
end
|
697
703
|
|
data/spec/spec_helper.rb
ADDED
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-filter-grok
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elasticsearch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: logstash
|
14
|
+
name: logstash-core
|
15
15
|
version_requirements: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - '>='
|
@@ -72,20 +72,6 @@ dependencies:
|
|
72
72
|
version: '0'
|
73
73
|
prerelease: false
|
74
74
|
type: :development
|
75
|
-
- !ruby/object:Gem::Dependency
|
76
|
-
name: logstash-devutils
|
77
|
-
version_requirements: !ruby/object:Gem::Requirement
|
78
|
-
requirements:
|
79
|
-
- - '>='
|
80
|
-
- !ruby/object:Gem::Version
|
81
|
-
version: '0'
|
82
|
-
requirement: !ruby/object:Gem::Requirement
|
83
|
-
requirements:
|
84
|
-
- - '>='
|
85
|
-
- !ruby/object:Gem::Version
|
86
|
-
version: '0'
|
87
|
-
prerelease: false
|
88
|
-
type: :development
|
89
75
|
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
|
90
76
|
email: info@elasticsearch.com
|
91
77
|
executables: []
|
@@ -101,6 +87,7 @@ files:
|
|
101
87
|
- lib/logstash/filters/grok.rb
|
102
88
|
- logstash-filter-grok.gemspec
|
103
89
|
- spec/filters/grok_spec.rb
|
90
|
+
- spec/spec_helper.rb
|
104
91
|
homepage: http://www.elasticsearch.org/guide/en/logstash/current/index.html
|
105
92
|
licenses:
|
106
93
|
- Apache License (2.0)
|
@@ -129,3 +116,4 @@ specification_version: 4
|
|
129
116
|
summary: Parse arbitrary text and structure it.
|
130
117
|
test_files:
|
131
118
|
- spec/filters/grok_spec.rb
|
119
|
+
- spec/spec_helper.rb
|