logstash-filter-event_dispatcher 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 9159fd10a48e20fb69d7b031093fb9a988ed9eab027533cff446ad4ce1878bf4
4
+ data.tar.gz: a6355e2f50177b13370efafe5ff34c9da7c7df530c46f7d38b8bbdce2ba1dc3a
5
+ SHA512:
6
+ metadata.gz: 787353712f0d76a62489ece16c0dd7b4ef8fc6df4a53edd2274291d768efc47ad6d04581d4528bbc531183f3859601726350662f7f7381a55700e90dd54132fd
7
+ data.tar.gz: c641dd0f7d0274fba3586354e84a75126261c7d5a782ccaef3e158779dde967ee4537906d89f06183b2b028fc996913bfae883b72e2a4d5848f17fee46b49bef
data/CHANGELOG.md ADDED
@@ -0,0 +1,2 @@
1
+ ## 0.1.0
2
+ - Initial version
data/CONTRIBUTORS ADDED
@@ -0,0 +1,5 @@
1
+ The following is a list of people who have contributed ideas, code, bug
2
+ reports, or in general have helped logstash along its way.
3
+
4
+ Contributors:
5
+ * Weiping Lu (weipinglu)
data/Gemfile ADDED
@@ -0,0 +1,14 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ # logstash_path = ENV["LOGSTASH_PATH"] || "../../logstash"
6
+ # use_logstash_source = ENV["LOGSTASH_SOURCE"] && ENV["LOGSTASH_SOURCE"].to_s == "1"
7
+
8
+ logstash_path = "/Users/wlu/git/logstash"
9
+ use_logstash_source = 1
10
+
11
+ if Dir.exist?(logstash_path) && use_logstash_source
12
+ gem 'logstash-core', :path => "#{logstash_path}/logstash-core"
13
+ gem 'logstash-core-plugin-api', :path => "#{logstash_path}/logstash-core-plugin-api"
14
+ end
data/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2020 Elastic and contributors
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
data/README.md ADDED
@@ -0,0 +1,98 @@
1
+ # Logstash Plugin
2
+
3
+ [![Travis Build Status](https://travis-ci.com/logstash-plugins/logstash-filter-csv.svg)](https://travis-ci.com/logstash-plugins/logstash-filter-event_dispatcher)
4
+
5
+ This is a plugin for [Logstash](https://github.com/elastic/logstash).
6
+
7
+ It is fully free and fully open source. The license is Apache 2.0, meaning you are pretty much free to use it however you want in whatever way.
8
+
9
+ ## Documentation
10
+
11
+ Logstash provides infrastructure to automatically generate documentation for this plugin. We use the asciidoc format to write documentation so any comments in the source code will be first converted into asciidoc and then into html. All plugin documentation are placed under one [central location](http://www.elastic.co/guide/en/logstash/current/).
12
+
13
+ - For formatting code or config example, you can use the asciidoc `[source,ruby]` directive
14
+ - For more asciidoc formatting tips, see the excellent reference here https://github.com/elastic/docs#asciidoc-guide
15
+
16
+ ## Need Help?
17
+
18
+ Need help? Try #logstash on freenode IRC or the https://discuss.elastic.co/c/logstash discussion forum.
19
+
20
+ ## Developing
21
+
22
+ ### 1. Plugin Development and Testing
23
+
24
+ #### Code
25
+ - To get started, you'll need JRuby with the Bundler gem installed.
26
+
27
+ - Create a new plugin or clone an existing one from the GitHub [logstash-plugins](https://github.com/logstash-plugins) organization. We also provide [example plugins](https://github.com/logstash-plugins?query=example).
28
+
29
+ - Install dependencies
30
+ ```sh
31
+ bundle install
32
+ ```
33
+
34
+ #### Test
35
+
36
+ - Update your dependencies
37
+
38
+ ```sh
39
+ bundle install
40
+ ```
41
+
42
+ - Run tests
43
+
44
+ ```sh
45
+ bundle exec rspec
46
+ ```
47
+
48
+ ### 2. Running your unpublished Plugin in Logstash
49
+
50
+ #### 2.1 Run in a local Logstash clone
51
+
52
+ - Edit Logstash `Gemfile` and add the local plugin path, for example:
53
+ ```ruby
54
+ gem "logstash-filter-awesome", :path => "/your/local/logstash-filter-awesome"
55
+ ```
56
+ - Install plugin
57
+ ```sh
58
+ # Logstash 2.3 and higher
59
+ bin/logstash-plugin install --no-verify
60
+
61
+ # Prior to Logstash 2.3
62
+ bin/plugin install --no-verify
63
+
64
+ ```
65
+ - Run Logstash with your plugin
66
+ ```sh
67
+ bin/logstash -e 'filter {awesome {}}'
68
+ ```
69
+ At this point any modifications to the plugin code will be applied to this local Logstash setup. After modifying the plugin, simply rerun Logstash.
70
+
71
+ #### 2.2 Run in an installed Logstash
72
+
73
+ 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:
74
+
75
+ - Build your plugin gem
76
+ ```sh
77
+ gem build logstash-filter-awesome.gemspec
78
+ ```
79
+ - Install the plugin from the Logstash home
80
+ ```sh
81
+ # Logstash 2.3 and higher
82
+ bin/logstash-plugin install --no-verify
83
+
84
+ # Prior to Logstash 2.3
85
+ bin/plugin install --no-verify
86
+
87
+ ```
88
+ - Start Logstash and proceed to test the plugin
89
+
90
+ ## Contributing
91
+
92
+ All contributions are welcome: ideas, patches, documentation, bug reports, complaints, and even something you drew up on a napkin.
93
+
94
+ 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.
95
+
96
+ It is more important to the community that you are able to contribute.
97
+
98
+ For more information about contributing, see the [CONTRIBUTING](https://github.com/elastic/logstash/blob/master/CONTRIBUTING.md) file.
@@ -0,0 +1,166 @@
1
+ # encoding: utf-8
2
+ require 'json'
3
+ require "logstash/filters/base"
4
+ require "logstash/namespace"
5
+
6
+ # This filter has a wrapper "filter" object (@filter) which contains a list of "filter_part" objects.
7
+ # Each "filter_part" can be a wrapped filter plugin object or a (nested) wrapper "filter" object.
8
+ #
9
+ # The "filter" object is defined in the configuration json file provided by the user at this location: "#{@config_dir}/#{@config_json_filename}" .
10
+ # It is instantiated when the "register" method is called.
11
+ # All filter plugin objects contained in the "filter" object also get instatialed/registered at this time.
12
+ #
13
+ # When the "filter" method is called, it simply delegates the call to the "filter" object's "filter" method
14
+ # which in turns calls the "filter" methods of the contained "filter_part" objects.
15
+ # The final outcome of the "filter" method call is entirely determined by the control flow logic defined in
16
+ # the confguration json file provided by the user
17
+ #
18
+ class LogStash::Filters::Event_dispatcher < LogStash::Filters::Base
19
+
20
+ config_name "event_dispatcher"
21
+
22
+ # Local file folder path where the config json file is located
23
+ config :config_dir, :validate => :string, :default => "#{Dir::home()}/tmp/event_dispatcher/config"
24
+
25
+ #Name of the config json file
26
+ config :config_json_filename, :validate => :string, :default => "filter.json"
27
+
28
+ #Name of event_filter_tag field, the value of this field can be read and/or set by each filter_part
29
+ #for correctly controlling the event's filter path.
30
+ config :event_filter_tag_field, :validate => :string, :default => "event_filter_tag"
31
+
32
+ #Name of event_filter_done field, the value of this field is used by each filter_part
33
+ #to determine if it can stop traversing all filter_parts's "filter" methods
34
+ config :event_filter_done_field, :validate => :string, :default => "event_filter_done"
35
+
36
+ #Local debug flag
37
+ config :localDebug, :validate => :boolean, :default => false
38
+
39
+ def register
40
+ filter_json_file_path = "#{@config_dir}/#{@config_json_filename}"
41
+ @logger.debug? && @logger.debug("Running event_dispatcher register, filter_json_file_path: #{filter_json_file_path}")
42
+ @localDebug && (puts "LD> Running event_dispatcher register, filter_json_file_path: #{filter_json_file_path}")
43
+
44
+ filter_json_string = File.read(filter_json_file_path)
45
+ filter_json = JSON.parse(filter_json_string)
46
+ @logger.debug? && @logger.debug("filter_json loaded: #{filter_json}")
47
+ @localDebug && (puts "LD> filter_json loaded: #{filter_json}")
48
+
49
+ if resolve_references(filter_json)
50
+ @logger.debug? && @logger.debug("filter_json resolved: #{filter_json}")
51
+ @localDebug && (puts "LD> filter_json resolved: #{filter_json}")
52
+ end
53
+
54
+ filter_part_json = { "filter_parts" => filter_json }
55
+ @filter = Filter.new(filter_part_json, @config)
56
+
57
+ end
58
+
59
+ #resolve any references to ${config_dir} in all path strings
60
+ def resolve_references(filter_json)
61
+ modified = false
62
+ filter_json.each do |part|
63
+ if part["type"] == "filter"
64
+ filter_parts = part["filter_parts"]
65
+ if filter_parts.class == String
66
+ filter_parts_new = filter_parts.gsub("${config_dir}", "#{config_dir}")
67
+ if filter_parts_new != filter_parts
68
+ modified = true
69
+ filter_json_1 = File.read(filter_parts_new)
70
+ filter_parts = JSON.parse(filter_json_1)
71
+ part["filter_parts"] = filter_parts
72
+ end
73
+ end
74
+ if resolve_references(filter_parts)
75
+ modified = true
76
+ end
77
+ elsif part["type"] == "plugin" && part["name"] == "ruby"
78
+ path = part["options"]["path"]
79
+ unless path.nil?
80
+ path_new = path.gsub("${config_dir}", "#{config_dir}")
81
+ if path_new != path
82
+ modified = true
83
+ part["options"]["path"] = path_new
84
+ end
85
+ end
86
+ end
87
+ end
88
+ return modified
89
+ end
90
+
91
+ public
92
+
93
+ def filter(event)
94
+ @logger.debug? && @logger.debug("Running event_dispatcher filter", :event => event.to_hash)
95
+ @localDebug && (puts "LD> Running event_dispatcher filter, event: #{event.to_hash}")
96
+
97
+ @filter.filter(event)
98
+ filter_matched(event)
99
+ @logger.debug? && @logger.debug("Event after event_dispatcher filter", :event => event.to_hash)
100
+ @localDebug && (puts "LD> Event after event_dispatcher filte, event: #{event.to_hash}")
101
+ end
102
+
103
+ end
104
+
105
+ class Filter_part
106
+ def initialize(part_json, config)
107
+ @event_filter_tags_to_process = part_json["event_filter_tags_to_process"]
108
+ @set_event_filter_done_if_executed = part_json["set_event_filter_done_if_executed"] || false
109
+ @config = config
110
+ end
111
+
112
+ def Filter_part.new_part(part_json, config)
113
+ type = part_json['type']
114
+ if type == "plugin"
115
+ return Plugin.new(part_json, config)
116
+ elsif type == "filter"
117
+ return Filter.new(part_json, config)
118
+ end
119
+ nil
120
+ end
121
+ end
122
+
123
+ class Plugin < Filter_part
124
+ def initialize(part_json, config)
125
+ super(part_json, config)
126
+ p = part_json
127
+ name = p["name"]
128
+ path = p["require_path"].nil? ? "logstash/filters/#{name}" : p["require_path"]
129
+ require path
130
+ @plugin = LogStash::Plugin.lookup("filter", name).new(p["options"])
131
+ @plugin.register
132
+ end
133
+
134
+ public
135
+
136
+ def filter(event)
137
+ if not @event_filter_tags_to_process.nil?
138
+ event_filter_tag = event.get(@config["event_filter_tag_field"])
139
+ if not @event_filter_tags_to_process.include?(event_filter_tag)
140
+ return false
141
+ end
142
+ end
143
+ @plugin.filter(event)
144
+ return @set_event_filter_done_if_executed
145
+ end
146
+ end
147
+
148
+ class Filter < Filter_part
149
+ def initialize(part_json, config)
150
+ super(part_json, config)
151
+ @filter_parts = []
152
+ part_json["filter_parts"].each do |p|
153
+ @filter_parts << Filter_part.new_part(p, config)
154
+ end
155
+ end
156
+
157
+ public
158
+
159
+ def filter(event)
160
+ @filter_parts.each do |p|
161
+ if p.filter(event)
162
+ return
163
+ end
164
+ end
165
+ end
166
+ end
@@ -0,0 +1,28 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = 'logstash-filter-event_dispatcher'
3
+ s.version = '0.1.0'
4
+ s.licenses = ['Apache License (2.0)']
5
+ s.summary = "This example filter replaces the contents of the message field with the specified value."
6
+ s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
7
+ s.authors = ["Elastic"]
8
+ s.email = 'info@elastic.co'
9
+ s.homepage = "http://www.elastic.co/guide/en/logstash/current/index.html"
10
+ s.require_paths = ["lib"]
11
+
12
+ # Files
13
+ s.files = Dir['lib/**/*','spec/**/*','vendor/**/*','*.gemspec','*.md','CONTRIBUTORS','Gemfile','LICENSE','NOTICE.TXT']
14
+ # Tests
15
+ s.test_files = s.files.grep(%r{^(test|spec|features)/})
16
+
17
+ # Special flag to let us know this is actually a logstash plugin
18
+ s.metadata = { "logstash_plugin" => "true", "logstash_group" => "filter" }
19
+
20
+ # Gem dependencies
21
+ s.add_runtime_dependency "logstash-core-plugin-api"
22
+ s.add_development_dependency 'logstash-devutils'
23
+ s.add_development_dependency 'logstash-filter-csv'
24
+ s.add_development_dependency 'logstash-filter-json'
25
+ s.add_development_dependency 'logstash-filter-ruby'
26
+ s.add_development_dependency 'logstash-filter-kv'
27
+ s.add_development_dependency 'insist'
28
+ end
@@ -0,0 +1,35 @@
1
+ # encoding: utf-8
2
+ require 'spec_helper'
3
+ require "logstash/filters/event_dispatcher"
4
+ require "insist"
5
+
6
+ describe LogStash::Filters::Event_dispatcher do
7
+ describe "case_1: event_filter_tag already set in event" do
8
+ let(:config) do <<-CONFIG
9
+ filter {
10
+ json {
11
+ source => "message"
12
+ }
13
+ }
14
+ filter {
15
+ event_dispatcher {
16
+ config_dir => "#{File.dirname(__FILE__)}/case_1"
17
+ }
18
+ }
19
+ CONFIG
20
+ end
21
+
22
+ sample '{ "event_filter_tag": "csv_logs", "message": "4,2018-07-05T22:58:10Z,Mastercard,Mike Smith,Male,196.160.55.191,Food,USA,32" }' do
23
+ insist { subject.get("id") } == "4"
24
+ insist { subject.get("timestamp") } == "2018-07-05T22:58:10Z"
25
+ insist { subject.get("ip_address") } == "196.160.55.191"
26
+ insist { subject.get("age") } == "32"
27
+ end
28
+
29
+ sample '{ "event_filter_tag": "json_logs", "message": "{\"Property 1\":\"value x\",\"Property 2\":\"value y\"}" }' do
30
+ insist { subject.get("Property 1") } == "value x"
31
+ insist { subject.get("Property 2") } == "value y"
32
+ end
33
+
34
+ end
35
+ end
@@ -0,0 +1,25 @@
1
+ [
2
+ {
3
+ "type": "plugin",
4
+ "require_path": "logstash/filters/csv",
5
+ "name": "csv",
6
+ "options": {
7
+ "columns": ["id", "timestamp", "paymentType", "name", "gender", "ip_address", "purpose", "country", "age"]
8
+ },
9
+ "event_filter_tags_to_process": [
10
+ "csv_logs"
11
+ ],
12
+ "set_event_filter_done_if_executed": true
13
+ },
14
+ {
15
+ "type": "plugin",
16
+ "name": "json",
17
+ "options": {
18
+ "source": "message"
19
+ },
20
+ "event_filter_tags_to_process": [
21
+ "json_logs"
22
+ ],
23
+ "set_event_filter_done_if_executed": true
24
+ }
25
+ ]
@@ -0,0 +1,30 @@
1
+ # encoding: utf-8
2
+ require 'spec_helper'
3
+ require "logstash/filters/event_dispatcher"
4
+ require "insist"
5
+
6
+ describe LogStash::Filters::Event_dispatcher do
7
+ describe "case_2: event_filter_tag set by ruby plugin" do
8
+ let(:config) do <<-CONFIG
9
+ filter {
10
+ event_dispatcher {
11
+ config_dir => "#{File.dirname(__FILE__)}/case_2"
12
+ }
13
+ }
14
+ CONFIG
15
+ end
16
+
17
+ sample '4,2018-07-05T22:58:10Z,Mastercard,Mike Smith,Male,196.160.55.191,Food,USA,32' do
18
+ insist { subject.get("id") } == "4"
19
+ insist { subject.get("timestamp") } == "2018-07-05T22:58:10Z"
20
+ insist { subject.get("ip_address") } == "196.160.55.191"
21
+ insist { subject.get("age") } == "32"
22
+ end
23
+
24
+ sample '{"Property 1": "value x", "Property 2": "value y"}' do
25
+ insist { subject.get("Property 1") } == "value x"
26
+ insist { subject.get("Property 2") } == "value y"
27
+ end
28
+
29
+ end
30
+ end
@@ -0,0 +1,32 @@
1
+ [
2
+ {
3
+ "type": "plugin",
4
+ "name": "ruby",
5
+ "options": {
6
+ "code": "tag = event.get('message').strip.start_with?('\u007B') ? 'json_logs' : 'csv_logs'; event.set('event_filter_tag', tag)"
7
+ }
8
+ },
9
+ {
10
+ "type": "plugin",
11
+ "require_path": "logstash/filters/csv",
12
+ "name": "csv",
13
+ "options": {
14
+ "columns": ["id", "timestamp", "paymentType", "name", "gender", "ip_address", "purpose", "country", "age"]
15
+ },
16
+ "event_filter_tags_to_process": [
17
+ "csv_logs"
18
+ ],
19
+ "set_event_filter_done_if_executed": true
20
+ },
21
+ {
22
+ "type": "plugin",
23
+ "name": "json",
24
+ "options": {
25
+ "source": "message"
26
+ },
27
+ "event_filter_tags_to_process": [
28
+ "json_logs"
29
+ ],
30
+ "set_event_filter_done_if_executed": true
31
+ }
32
+ ]
@@ -0,0 +1,54 @@
1
+ # encoding: utf-8
2
+ require 'spec_helper'
3
+ require "logstash/filters/event_dispatcher"
4
+ require "insist"
5
+
6
+ describe LogStash::Filters::Event_dispatcher do
7
+ describe "case_3: nested filter paths" do
8
+ let(:config) do <<-CONFIG
9
+ filter {
10
+ event_dispatcher {
11
+ config_dir => "#{File.dirname(__FILE__)}/case_3"
12
+ # localDebug => true
13
+ }
14
+ }
15
+ CONFIG
16
+ end
17
+
18
+ sample 'level_1_tag=csv,event_log=1,2019-08-29T01:53:12Z,Amex,Giovanna Van der Linde,Female,185.216.194.245,Industrial,Philippines,55' do
19
+ insist { subject.get("id") } == "1"
20
+ insist { subject.get("timestamp") } == "2019-08-29T01:53:12Z"
21
+ insist { subject.get("ip_address") } == "185.216.194.245"
22
+ end
23
+
24
+ sample 'level_1_tag=kv,event_log=a:1 b:2 c:3' do
25
+ insist { subject.get("a") } == "1"
26
+ insist { subject.get("b") } == "2"
27
+ insist { subject.get("c") } == "3"
28
+ end
29
+
30
+ sample 'level_1_tag=filter_1,event_log=level_1x_tag=filter_11,event_log=(kv=)a=1,b=2,c=3,d=4,e=5' do
31
+ insist { subject.get("a") } == "1"
32
+ insist { subject.get("b") } == "2"
33
+ insist { subject.get("c") } == "3"
34
+ end
35
+
36
+ sample 'level_1_tag=filter_1,event_log=level_1x_tag=filter_11,event_log=(json){"Property 1":"value x","Property 2":"value y"}' do
37
+ insist { subject.get("Property 1") } == "value x"
38
+ insist { subject.get("Property 2") } == "value y"
39
+ end
40
+
41
+ sample 'level_1_tag=filter_1,event_log=level_1x_tag=filter_11,event_log=(kv|)a|1,b|2,c|3,d|4,e|5' do
42
+ insist { subject.get("a") } == "1"
43
+ insist { subject.get("b") } == "2"
44
+ insist { subject.get("c") } == "3"
45
+ end
46
+
47
+ sample 'level_1_tag=filter_1,event_log=level_1x_tag=filter_11,event_log=(kv%)a%1,b%2,c%3,d%4,e%5' do
48
+ insist { subject.get("a") } == "1"
49
+ insist { subject.get("b") } == "2"
50
+ insist { subject.get("c") } == "3"
51
+ end
52
+
53
+ end
54
+ end
@@ -0,0 +1,13 @@
1
+ def filter(event)
2
+ m = event.get("message")
3
+ if m.start_with?("level_1_tag=")
4
+ i1 = "level_1_tag=".length
5
+ i2 = m.index(",")
6
+ event.set("event_filter_tag", m[i1..i2-1])
7
+ m1 = m[i2+1..]
8
+ if m1.start_with?("event_log=")
9
+ event.set("message", m1["event_log=".length..])
10
+ end
11
+ end
12
+ return [event]
13
+ end
@@ -0,0 +1,13 @@
1
+ def filter(event)
2
+ m = event.get("message")
3
+ if m.start_with?("level_1x_tag=")
4
+ i1 = "level_1x_tag=".length
5
+ i2 = m.index(",")
6
+ event.set("event_filter_tag", m[i1..i2-1])
7
+ m1 = m[i2+1..]
8
+ if m1.start_with?("event_log=")
9
+ event.set("message", m1["event_log=".length..])
10
+ end
11
+ end
12
+ return [event]
13
+ end
@@ -0,0 +1,10 @@
1
+ def filter(event)
2
+ m = event.get("message")
3
+ # e.g. m = "level_2_tag=filter_11,event_log=(kv=)a=1,b=2,c=3,d=4,e=5"
4
+ if m.start_with?("(")
5
+ i = m.index(")")
6
+ event.set("event_filter_tag", m[0..i])
7
+ event.set("message", m[i+1..])
8
+ end
9
+ return [event]
10
+ end
@@ -0,0 +1,51 @@
1
+ [
2
+ {
3
+ "type": "plugin",
4
+ "name": "ruby",
5
+ "description": "Get: level_1_tag/event_log, set: event_filter_tag/message",
6
+ "options": {
7
+ "path": "${config_dir}/code_1.rb"
8
+ }
9
+ },
10
+ {
11
+ "type": "plugin",
12
+ "name": "csv",
13
+ "event_filter_tags_to_process": [
14
+ "csv"
15
+ ],
16
+ "options": {
17
+ "columns": [
18
+ "id",
19
+ "timestamp",
20
+ "paymentType",
21
+ "name",
22
+ "gender",
23
+ "ip_address",
24
+ "purpose",
25
+ "country",
26
+ "age"
27
+ ]
28
+ },
29
+ "set_event_filter_done_if_executed": true
30
+ },
31
+ {
32
+ "type": "plugin",
33
+ "name": "kv",
34
+ "event_filter_tags_to_process": [
35
+ "kv"
36
+ ],
37
+ "options": {
38
+ "field_split": " ",
39
+ "value_split": ":"
40
+ },
41
+ "set_event_filter_done_if_executed": true
42
+ },
43
+ {
44
+ "type": "filter",
45
+ "event_filter_tags_to_process": [
46
+ "filter_1"
47
+ ],
48
+ "set_event_filter_done_if_executed": true,
49
+ "filter_parts": "${config_dir}/filter_1.json"
50
+ }
51
+ ]
@@ -0,0 +1,19 @@
1
+ [
2
+ {
3
+ "description": "Get: level_2_tag/event_log, set: event_filter_tag/message",
4
+ "type": "plugin",
5
+ "name": "ruby",
6
+ "options": {
7
+ "path": "${config_dir}/code_2.rb"
8
+ }
9
+ },
10
+ {
11
+ "type": "filter",
12
+ "event_filter_tags_to_process": [
13
+ "filter_11"
14
+ ],
15
+ "set_event_filter_done_if_executed": true,
16
+ "filter_parts": "${config_dir}/filter_11.json"
17
+ }
18
+ ]
19
+
@@ -0,0 +1,58 @@
1
+ [
2
+ {
3
+ "type": "plugin",
4
+ "name": "ruby",
5
+ "description": "Get: (json)|(kv=)|(kv==)|(kv%),set: event_filter_tag/message",
6
+ "options": {
7
+ "path": "${config_dir}/code_3.rb"
8
+ }
9
+ },
10
+ {
11
+ "type": "plugin",
12
+ "name": "kv",
13
+ "event_filter_tags_to_process": [
14
+ "(kv=)"
15
+ ],
16
+ "options": {
17
+ "field_split": ",",
18
+ "value_split": "="
19
+ },
20
+ "set_event_filter_done_if_executed": true
21
+ },
22
+ {
23
+ "type": "plugin",
24
+ "name": "json",
25
+ "event_filter_tags_to_process": [
26
+ "(json)"
27
+ ],
28
+ "options": {
29
+ "source": "message"
30
+ },
31
+ "set_event_filter_done_if_executed": true
32
+ },
33
+ {
34
+ "type": "plugin",
35
+ "name": "kv",
36
+ "event_filter_tags_to_process": [
37
+ "(kv|)"
38
+ ],
39
+ "options": {
40
+ "field_split": ",",
41
+ "value_split": "|"
42
+ },
43
+ "set_event_filter_done_if_executed": true
44
+ },
45
+ {
46
+ "type": "plugin",
47
+ "name": "kv",
48
+ "event_filter_tags_to_process": [
49
+ "(kv%)"
50
+ ],
51
+ "options": {
52
+ "field_split": ",",
53
+ "value_split": "%"
54
+ },
55
+ "set_event_filter_done_if_executed": true
56
+ }
57
+ ]
58
+
@@ -0,0 +1,6 @@
1
+ level_1_tag=csv,event_log=1,2019-08-29T01:53:12Z,Amex,Giovanna Van der Linde,Female,185.216.194.245,Industrial,Philippines,55
2
+ level_1_tag=json,event_log=a:1 b:2 c:3
3
+ level_1_tag=filter_1,event_log=level_1x_tag=filter_11,event_log=(kv=)a=1,b=2,c=3,d=4,e=5
4
+ level_1_tag=filter_1,event_log=level_1x_tag=filter_11,event_log=(json){"Property 1":"value x","Property 2":"value y"}
5
+ level_1_tag=filter_1,event_log=level_1x_tag=filter_11,event_log=(kv|)a|1,b|2,c|3,d|4,e|5
6
+ level_1_tag=filter_1,event_log=level_1x_tag=filter_11,event_log=(kv%)a%1,b%2,c%3,d%4,e%5
@@ -0,0 +1,110 @@
1
+ # encoding: utf-8
2
+ require 'spec_helper'
3
+ require "logstash/filters/event_dispatcher"
4
+ require "insist"
5
+
6
+ describe LogStash::Filters::Event_dispatcher do
7
+ describe "case_1: event_filter_tag already set in event" do
8
+ let(:config) do
9
+ <<-CONFIG
10
+ filter {
11
+ json {
12
+ source => "message"
13
+ }
14
+ }
15
+ filter {
16
+ event_dispatcher {
17
+ config_dir => "#{File.dirname(__FILE__)}/case_1"
18
+ }
19
+ }
20
+ CONFIG
21
+ end
22
+
23
+ sample '{ "event_filter_tag": "csv_logs", "message": "4,2018-07-05T22:58:10Z,Mastercard,Mike Smith,Male,196.160.55.191,Food,USA,32" }' do
24
+ insist { subject.get("id") } == "4"
25
+ insist { subject.get("timestamp") } == "2018-07-05T22:58:10Z"
26
+ insist { subject.get("ip_address") } == "196.160.55.191"
27
+ insist { subject.get("age") } == "32"
28
+ end
29
+
30
+ sample '{ "event_filter_tag": "json_logs", "message": "{\"Property 1\":\"value x\",\"Property 2\":\"value y\"}" }' do
31
+ insist { subject.get("Property 1") } == "value x"
32
+ insist { subject.get("Property 2") } == "value y"
33
+ end
34
+
35
+ end
36
+
37
+ describe "case_2: event_filter_tag set by ruby plugin" do
38
+ let(:config) do
39
+ <<-CONFIG
40
+ filter {
41
+ event_dispatcher {
42
+ config_dir => "#{File.dirname(__FILE__)}/case_2"
43
+ }
44
+ }
45
+ CONFIG
46
+ end
47
+
48
+ sample '4,2018-07-05T22:58:10Z,Mastercard,Mike Smith,Male,196.160.55.191,Food,USA,32' do
49
+ insist { subject.get("id") } == "4"
50
+ insist { subject.get("timestamp") } == "2018-07-05T22:58:10Z"
51
+ insist { subject.get("ip_address") } == "196.160.55.191"
52
+ insist { subject.get("age") } == "32"
53
+ end
54
+
55
+ sample '{"Property 1": "value x", "Property 2": "value y"}' do
56
+ insist { subject.get("Property 1") } == "value x"
57
+ insist { subject.get("Property 2") } == "value y"
58
+ end
59
+
60
+ end
61
+
62
+ describe "case_3: nested filter paths" do
63
+ let(:config) do
64
+ <<-CONFIG
65
+ filter {
66
+ event_dispatcher {
67
+ config_dir => "#{File.dirname(__FILE__)}/case_3"
68
+ # localDebug => true
69
+ }
70
+ }
71
+ CONFIG
72
+ end
73
+
74
+ sample 'level_1_tag=csv,event_log=1,2019-08-29T01:53:12Z,Amex,Giovanna Van der Linde,Female,185.216.194.245,Industrial,Philippines,55' do
75
+ insist { subject.get("id") } == "1"
76
+ insist { subject.get("timestamp") } == "2019-08-29T01:53:12Z"
77
+ insist { subject.get("ip_address") } == "185.216.194.245"
78
+ end
79
+
80
+ sample 'level_1_tag=kv,event_log=a:1 b:2 c:3' do
81
+ insist { subject.get("a") } == "1"
82
+ insist { subject.get("b") } == "2"
83
+ insist { subject.get("c") } == "3"
84
+ end
85
+
86
+ sample 'level_1_tag=filter_1,event_log=level_1x_tag=filter_11,event_log=(kv=)a=1,b=2,c=3,d=4,e=5' do
87
+ insist { subject.get("a") } == "1"
88
+ insist { subject.get("b") } == "2"
89
+ insist { subject.get("c") } == "3"
90
+ end
91
+
92
+ sample 'level_1_tag=filter_1,event_log=level_1x_tag=filter_11,event_log=(json){"Property 1":"value x","Property 2":"value y"}' do
93
+ insist { subject.get("Property 1") } == "value x"
94
+ insist { subject.get("Property 2") } == "value y"
95
+ end
96
+
97
+ sample 'level_1_tag=filter_1,event_log=level_1x_tag=filter_11,event_log=(kv|)a|1,b|2,c|3,d|4,e|5' do
98
+ insist { subject.get("a") } == "1"
99
+ insist { subject.get("b") } == "2"
100
+ insist { subject.get("c") } == "3"
101
+ end
102
+
103
+ sample 'level_1_tag=filter_1,event_log=level_1x_tag=filter_11,event_log=(kv%)a%1,b%2,c%3,d%4,e%5' do
104
+ insist { subject.get("a") } == "1"
105
+ insist { subject.get("b") } == "2"
106
+ insist { subject.get("c") } == "3"
107
+ end
108
+
109
+ end
110
+ end
@@ -0,0 +1,2 @@
1
+ # encoding: utf-8
2
+ require "logstash/devutils/rspec/spec_helper"
metadata ADDED
@@ -0,0 +1,180 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: logstash-filter-event_dispatcher
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Elastic
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2022-12-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '0'
19
+ name: logstash-core-plugin-api
20
+ prerelease: false
21
+ type: :runtime
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ name: logstash-devutils
34
+ prerelease: false
35
+ type: :development
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ name: logstash-filter-csv
48
+ prerelease: false
49
+ type: :development
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ requirement: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ name: logstash-filter-json
62
+ prerelease: false
63
+ type: :development
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ requirement: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ name: logstash-filter-ruby
76
+ prerelease: false
77
+ type: :development
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ requirement: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ name: logstash-filter-kv
90
+ prerelease: false
91
+ type: :development
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ requirement: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ name: insist
104
+ prerelease: false
105
+ type: :development
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ description: This gem is a Logstash plugin required to be installed on top of the
112
+ Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This
113
+ gem is not a stand-alone program
114
+ email: info@elastic.co
115
+ executables: []
116
+ extensions: []
117
+ extra_rdoc_files: []
118
+ files:
119
+ - CHANGELOG.md
120
+ - CONTRIBUTORS
121
+ - Gemfile
122
+ - LICENSE
123
+ - README.md
124
+ - lib/logstash/filters/event_dispatcher.rb
125
+ - logstash-filter-event_dispatcher.gemspec
126
+ - spec/filters/case_1/case_1.rb
127
+ - spec/filters/case_1/filter.json
128
+ - spec/filters/case_2/case_2.rb
129
+ - spec/filters/case_2/filter.json
130
+ - spec/filters/case_3/case_3.rb
131
+ - spec/filters/case_3/code_1.rb
132
+ - spec/filters/case_3/code_2.rb
133
+ - spec/filters/case_3/code_3.rb
134
+ - spec/filters/case_3/filter.json
135
+ - spec/filters/case_3/filter_1.json
136
+ - spec/filters/case_3/filter_11.json
137
+ - spec/filters/case_3/log.txt
138
+ - spec/filters/event_dispatcher_spec.rb
139
+ - spec/spec_helper.rb
140
+ homepage: http://www.elastic.co/guide/en/logstash/current/index.html
141
+ licenses:
142
+ - Apache License (2.0)
143
+ metadata:
144
+ logstash_plugin: 'true'
145
+ logstash_group: filter
146
+ post_install_message:
147
+ rdoc_options: []
148
+ require_paths:
149
+ - lib
150
+ required_ruby_version: !ruby/object:Gem::Requirement
151
+ requirements:
152
+ - - ">="
153
+ - !ruby/object:Gem::Version
154
+ version: '0'
155
+ required_rubygems_version: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ requirements: []
161
+ rubygems_version: 3.2.33
162
+ signing_key:
163
+ specification_version: 4
164
+ summary: This example filter replaces the contents of the message field with the specified
165
+ value.
166
+ test_files:
167
+ - spec/filters/case_1/case_1.rb
168
+ - spec/filters/case_1/filter.json
169
+ - spec/filters/case_2/case_2.rb
170
+ - spec/filters/case_2/filter.json
171
+ - spec/filters/case_3/case_3.rb
172
+ - spec/filters/case_3/code_1.rb
173
+ - spec/filters/case_3/code_2.rb
174
+ - spec/filters/case_3/code_3.rb
175
+ - spec/filters/case_3/filter.json
176
+ - spec/filters/case_3/filter_1.json
177
+ - spec/filters/case_3/filter_11.json
178
+ - spec/filters/case_3/log.txt
179
+ - spec/filters/event_dispatcher_spec.rb
180
+ - spec/spec_helper.rb