logstash-input-fifo 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1 -1
  3. data/logstash-input-fifo.gemspec +6 -2
  4. data/vendor/bundle/jruby/1.9/cache/logstash-codec-json-3.0.2.gem +0 -0
  5. data/vendor/bundle/jruby/1.9/cache/logstash-codec-json_lines-3.0.2.gem +0 -0
  6. data/vendor/bundle/jruby/1.9/cache/logstash-codec-line-3.0.2.gem +0 -0
  7. data/vendor/bundle/jruby/1.9/gems/logstash-codec-json-3.0.2/CHANGELOG.md +37 -0
  8. data/vendor/bundle/jruby/1.9/gems/logstash-codec-json-3.0.2/CONTRIBUTORS +17 -0
  9. data/vendor/bundle/jruby/1.9/gems/logstash-codec-json-3.0.2/Gemfile +4 -0
  10. data/vendor/bundle/jruby/1.9/gems/logstash-codec-json-3.0.2/LICENSE +13 -0
  11. data/vendor/bundle/jruby/1.9/gems/logstash-codec-json-3.0.2/NOTICE.TXT +5 -0
  12. data/vendor/bundle/jruby/1.9/gems/logstash-codec-json-3.0.2/README.md +98 -0
  13. data/vendor/bundle/jruby/1.9/gems/logstash-codec-json-3.0.2/lib/logstash/codecs/json.rb +85 -0
  14. data/vendor/bundle/jruby/1.9/gems/logstash-codec-json-3.0.2/logstash-codec-json.gemspec +26 -0
  15. data/vendor/bundle/jruby/1.9/gems/logstash-codec-json-3.0.2/spec/codecs/json_spec.rb +191 -0
  16. data/vendor/bundle/jruby/1.9/gems/logstash-codec-json_lines-3.0.2/CHANGELOG.md +31 -0
  17. data/vendor/bundle/jruby/1.9/gems/logstash-codec-json_lines-3.0.2/CONTRIBUTORS +19 -0
  18. data/vendor/bundle/jruby/1.9/gems/logstash-codec-json_lines-3.0.2/Gemfile +4 -0
  19. data/vendor/bundle/jruby/1.9/gems/logstash-codec-json_lines-3.0.2/LICENSE +13 -0
  20. data/vendor/bundle/jruby/1.9/gems/logstash-codec-json_lines-3.0.2/NOTICE.TXT +5 -0
  21. data/vendor/bundle/jruby/1.9/gems/logstash-codec-json_lines-3.0.2/README.md +98 -0
  22. data/vendor/bundle/jruby/1.9/gems/logstash-codec-json_lines-3.0.2/lib/logstash/codecs/json_lines.rb +74 -0
  23. data/vendor/bundle/jruby/1.9/gems/logstash-codec-json_lines-3.0.2/logstash-codec-json_lines.gemspec +29 -0
  24. data/vendor/bundle/jruby/1.9/gems/logstash-codec-json_lines-3.0.2/spec/codecs/json_lines_spec.rb +218 -0
  25. data/vendor/bundle/jruby/1.9/gems/logstash-codec-line-3.0.2/CHANGELOG.md +19 -0
  26. data/vendor/bundle/jruby/1.9/gems/logstash-codec-line-3.0.2/CONTRIBUTORS +15 -0
  27. data/vendor/bundle/jruby/1.9/gems/logstash-codec-line-3.0.2/Gemfile +4 -0
  28. data/vendor/bundle/jruby/1.9/gems/logstash-codec-line-3.0.2/LICENSE +13 -0
  29. data/vendor/bundle/jruby/1.9/gems/logstash-codec-line-3.0.2/NOTICE.TXT +5 -0
  30. data/vendor/bundle/jruby/1.9/gems/logstash-codec-line-3.0.2/README.md +98 -0
  31. data/vendor/bundle/jruby/1.9/gems/logstash-codec-line-3.0.2/lib/logstash/codecs/line.rb +60 -0
  32. data/vendor/bundle/jruby/1.9/gems/logstash-codec-line-3.0.2/logstash-codec-line.gemspec +27 -0
  33. data/vendor/bundle/jruby/1.9/gems/logstash-codec-line-3.0.2/spec/codecs/line_spec.rb +106 -0
  34. data/vendor/bundle/jruby/1.9/specifications/logstash-codec-json-3.0.2.gemspec +36 -0
  35. data/vendor/bundle/jruby/1.9/specifications/logstash-codec-json_lines-3.0.2.gemspec +39 -0
  36. data/vendor/bundle/jruby/1.9/specifications/logstash-codec-line-3.0.2.gemspec +36 -0
  37. metadata +77 -2
@@ -0,0 +1,31 @@
1
+ ## 3.0.2
2
+ - Relax constraint on logstash-core-plugin-api to >= 1.60 <= 2.99
3
+
4
+ ## 3.0.1
5
+ - Republish all the gems under jruby.
6
+ ## 3.0.0
7
+ - Update the plugin to the version 2.0 of the plugin api, this change is required for Logstash 5.0 compatibility. See https://github.com/elastic/logstash/issues/5141
8
+ # 2.1.3
9
+ - Depend on logstash-core-plugin-api instead of logstash-core, removing the need to mass update plugins on major releases of logstash
10
+ # 2.1.2
11
+ - New dependency requirements for logstash-core for the 5.0 release
12
+ ## 2.1.0
13
+ - Backward compatible support for `Event#from_json` method https://github.com/logstash-plugins/logstash-codec-json_lines/pull/19
14
+
15
+ ## 2.0.5
16
+ - Directly use buftok to avoid indirection through the line codec https://github.com/logstash-plugins/logstash-codec-json_lines/pull/18
17
+
18
+ ## 2.0.4
19
+ - Support for customizable delimiter
20
+
21
+ ## 2.0.3
22
+ - Fixed Timestamp check in specs
23
+
24
+ ## 2.0.0
25
+ - Plugins were updated to follow the new shutdown semantic, this mainly allows Logstash to instruct input plugins to terminate gracefully,
26
+ instead of using Thread.raise on the plugins' threads. Ref: https://github.com/elastic/logstash/pull/3895
27
+ - Dependency on logstash-core update to 2.0
28
+
29
+ ## 1.0.1
30
+ - Improve documentation to warn about using this codec with a line oriented input.
31
+ - light refactor of decode method
@@ -0,0 +1,19 @@
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
+ * Colin Surprenant (colinsurprenant)
6
+ * Greg Mefford (GregMefford)
7
+ * Jordan Sissel (jordansissel)
8
+ * João Duarte (jsvd)
9
+ * Nick Ethier (nickethier)
10
+ * Pier-Hugues Pellerin (ph)
11
+ * Richard Pijnenburg (electrical)
12
+ * Suyog Rao (suyograo)
13
+ * Tal Levy (talevy)
14
+ * Guy Boertje (guyboertje)
15
+
16
+ Note: If you've sent us patches, bug reports, or otherwise contributed to
17
+ Logstash, and you aren't on the list above and want to be, please let us know
18
+ and we'll make sure you're here. Contributions from folks like you are what make
19
+ open source awesome.
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in logstash-mass_effect.gemspec
4
+ gemspec
@@ -0,0 +1,13 @@
1
+ Copyright (c) 2012–2016 Elasticsearch <http://www.elastic.co>
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
@@ -0,0 +1,5 @@
1
+ Elasticsearch
2
+ Copyright 2012-2015 Elasticsearch
3
+
4
+ This product includes software developed by The Apache Software
5
+ Foundation (http://www.apache.org/).
@@ -0,0 +1,98 @@
1
+ # Logstash Plugin
2
+
3
+ [![Travis Build Status](https://travis-ci.org/logstash-plugins/logstash-codec-json_lines.svg)](https://travis-ci.org/logstash-plugins/logstash-codec-json_lines)
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 Developement 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 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).
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,74 @@
1
+ # encoding: utf-8
2
+ require "logstash/codecs/base"
3
+ require "logstash/util/charset"
4
+ require "logstash/util/buftok"
5
+ require "logstash/json"
6
+
7
+ # This codec will decode streamed JSON that is newline delimited.
8
+ # Encoding will emit a single JSON string ending in a `@delimiter`
9
+ # NOTE: Do not use this codec if your source input is line-oriented JSON, for
10
+ # example, redis or file inputs. Rather, use the json codec.
11
+ # More info: This codec is expecting to receive a stream (string) of newline
12
+ # terminated lines. The file input will produce a line string without a newline.
13
+ # Therefore this codec cannot work with line oriented inputs.
14
+ class LogStash::Codecs::JSONLines < LogStash::Codecs::Base
15
+ config_name "json_lines"
16
+
17
+ # The character encoding used in this codec. Examples include `UTF-8` and
18
+ # `CP1252`
19
+ #
20
+ # JSON requires valid `UTF-8` strings, but in some cases, software that
21
+ # emits JSON does so in another encoding (nxlog, for example). In
22
+ # weird cases like this, you can set the charset setting to the
23
+ # actual encoding of the text and logstash will convert it for you.
24
+ #
25
+ # For nxlog users, you'll want to set this to `CP1252`
26
+ config :charset, :validate => ::Encoding.name_list, :default => "UTF-8"
27
+
28
+ # Change the delimiter that separates lines
29
+ config :delimiter, :validate => :string, :default => "\n"
30
+
31
+ public
32
+
33
+ def register
34
+ @buffer = FileWatch::BufferedTokenizer.new(@delimiter)
35
+ @converter = LogStash::Util::Charset.new(@charset)
36
+ @converter.logger = @logger
37
+ end
38
+
39
+ def decode(data, &block)
40
+ @buffer.extract(data).each do |line|
41
+ parse(@converter.convert(line), &block)
42
+ end
43
+ end
44
+
45
+ def encode(event)
46
+ # Tack on a @delimiter for now because previously most of logstash's JSON
47
+ # outputs emitted one per line, and whitespace is OK in json.
48
+ @on_event.call(event, "#{event.to_json}#{@delimiter}")
49
+ end
50
+
51
+ private
52
+
53
+ # from_json_parse uses the Event#from_json method to deserialize and directly produce events
54
+ def from_json_parse(json, &block)
55
+ LogStash::Event.from_json(json).each { |event| yield event }
56
+ rescue LogStash::Json::ParserError => e
57
+ @logger.warn("JSON parse error, original data now in message field", :error => e, :data => json)
58
+ yield LogStash::Event.new("message" => json, "tags" => ["_jsonparsefailure"])
59
+ end
60
+
61
+ # legacy_parse uses the LogStash::Json class to deserialize json
62
+ def legacy_parse(json, &block)
63
+ # ignore empty/blank lines which LogStash::Json#load returns as nil
64
+ o = LogStash::Json.load(json)
65
+ yield(LogStash::Event.new(o)) if o
66
+ rescue LogStash::Json::ParserError => e
67
+ @logger.warn("JSON parse error, original data now in message field", :error => e, :data => json)
68
+ yield LogStash::Event.new("message" => json, "tags" => ["_jsonparsefailure"])
69
+ end
70
+
71
+ # keep compatibility with all v2.x distributions. only in 2.3 will the Event#from_json method be introduced
72
+ # and we need to keep compatibility for all v2 releases.
73
+ alias_method :parse, LogStash::Event.respond_to?(:from_json) ? :from_json_parse : :legacy_parse
74
+ end
@@ -0,0 +1,29 @@
1
+ Gem::Specification.new do |s|
2
+
3
+ s.name = 'logstash-codec-json_lines'
4
+ s.version = '3.0.2'
5
+ s.licenses = ['Apache License (2.0)']
6
+ s.summary = "This codec will decode streamed JSON that is newline delimited."
7
+ 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"
8
+ s.authors = ["Elastic"]
9
+ s.email = 'info@elastic.co'
10
+ s.homepage = "http://www.elastic.co/guide/en/logstash/current/index.html"
11
+ s.require_paths = ["lib"]
12
+
13
+ # Files
14
+ s.files = Dir['lib/**/*','spec/**/*','*.gemspec','*.md','CONTRIBUTORS','Gemfile','LICENSE','NOTICE.TXT']
15
+
16
+ # Tests
17
+ s.test_files = s.files.grep(%r{^(test|spec|features)/})
18
+
19
+ # Special flag to let us know this is actually a logstash plugin
20
+ s.metadata = { "logstash_plugin" => "true", "logstash_group" => "codec" }
21
+
22
+ # Gem dependencies
23
+ s.add_runtime_dependency "logstash-core-plugin-api", ">= 1.60", "<= 2.99"
24
+
25
+ s.add_runtime_dependency 'logstash-codec-line', '>= 2.1.0'
26
+
27
+ s.add_development_dependency 'logstash-devutils'
28
+ end
29
+
@@ -0,0 +1,218 @@
1
+ # encoding: utf-8
2
+
3
+ require "logstash/codecs/json_lines"
4
+ require "logstash/event"
5
+ require "logstash/json"
6
+ require "insist"
7
+
8
+ describe LogStash::Codecs::JSONLines do
9
+
10
+ let(:codec_options) { {} }
11
+
12
+ shared_examples :codec do
13
+
14
+ context "#decode" do
15
+ it "should return an event from json data" do
16
+ data = {"foo" => "bar", "baz" => {"bah" => ["a","b","c"]}}
17
+ subject.decode(LogStash::Json.dump(data) + "\n") do |event|
18
+ insist { event.is_a? LogStash::Event }
19
+ insist { event.get("foo") } == data["foo"]
20
+ insist { event.get("baz") } == data["baz"]
21
+ insist { event.get("bah") } == data["bah"]
22
+ end
23
+ end
24
+
25
+ it "should return an event from json data when a newline is recieved" do
26
+ data = {"foo" => "bar", "baz" => {"bah" => ["a","b","c"]}}
27
+ subject.decode(LogStash::Json.dump(data)) do |event|
28
+ insist {false}
29
+ end
30
+ subject.decode("\n") do |event|
31
+ insist { event.is_a? LogStash::Event }
32
+ insist { event.get("foo") } == data["foo"]
33
+ insist { event.get("baz") } == data["baz"]
34
+ insist { event.get("bah") } == data["bah"]
35
+ end
36
+ end
37
+
38
+ context "when using custom delimiter" do
39
+ let(:delimiter) { "|" }
40
+ let(:line) { "{\"hey\":1}|{\"hey\":2}|{\"hey\":3}|" }
41
+ let(:codec_options) { { "delimiter" => delimiter } }
42
+
43
+ it "should decode multiple lines separated by the delimiter" do
44
+ result = []
45
+ subject.decode(line) { |event| result << event }
46
+ expect(result.size).to eq(3)
47
+ expect(result[0].get("hey")).to eq(1)
48
+ expect(result[1].get("hey")).to eq(2)
49
+ expect(result[2].get("hey")).to eq(3)
50
+ end
51
+ end
52
+
53
+ context "processing plain text" do
54
+ it "falls back to plain text" do
55
+ decoded = false
56
+ subject.decode("something that isn't json\n") do |event|
57
+ decoded = true
58
+ insist { event.is_a?(LogStash::Event) }
59
+ insist { event.get("message") } == "something that isn't json"
60
+ insist { event.get("tags") }.include?("_jsonparsefailure")
61
+ end
62
+ insist { decoded } == true
63
+ end
64
+ end
65
+
66
+ context "processing weird binary blobs" do
67
+ it "falls back to plain text and doesn't crash (LOGSTASH-1595)" do
68
+ decoded = false
69
+ blob = (128..255).to_a.pack("C*").force_encoding("ASCII-8BIT")
70
+ subject.decode(blob)
71
+ subject.decode("\n") do |event|
72
+ decoded = true
73
+ insist { event.is_a?(LogStash::Event) }
74
+ insist { event.get("message").encoding.to_s } == "UTF-8"
75
+ end
76
+ insist { decoded } == true
77
+ end
78
+ end
79
+
80
+ context "when json could not be parsed" do
81
+ let(:message) { "random_message\n" }
82
+
83
+ it "add the failure tag" do
84
+ subject.decode(message) do |event|
85
+ expect(event).to include "tags"
86
+ end
87
+ end
88
+
89
+ it "uses an array to store the tags" do
90
+ subject.decode(message) do |event|
91
+ expect(event.get('tags')).to be_a Array
92
+ end
93
+ end
94
+
95
+ it "add a json parser failure tag" do
96
+ subject.decode(message) do |event|
97
+ expect(event.get('tags')).to include "_jsonparsefailure"
98
+ end
99
+ end
100
+ end
101
+
102
+ context "blank lines" do
103
+ let(:collector) { Array.new }
104
+
105
+ it "should ignore bare blanks" do
106
+ subject.decode("\n\n") do |event|
107
+ collector.push(event)
108
+ end
109
+ expect(collector.size).to eq(0)
110
+ end
111
+
112
+ it "should ignore in between blank lines" do
113
+ subject.decode("\n{\"a\":1}\n\n{\"b\":2}\n\n") do |event|
114
+ collector.push(event)
115
+ end
116
+ expect(collector.size).to eq(2)
117
+ end
118
+ end
119
+
120
+ end
121
+
122
+ context "#encode" do
123
+ let(:data) { { LogStash::Event::TIMESTAMP => "2015-12-07T11:37:00.000Z", "foo" => "bar", "baz" => {"bah" => ["a","b","c"]}} }
124
+ let(:event) { LogStash::Event.new(data) }
125
+
126
+ it "should return json data" do
127
+ got_event = false
128
+ subject.on_event do |e, d|
129
+ insist { d } == "#{LogStash::Event.new(data).to_json}\n"
130
+ insist { LogStash::Json.load(d)["foo"] } == data["foo"]
131
+ insist { LogStash::Json.load(d)["baz"] } == data["baz"]
132
+ insist { LogStash::Json.load(d)["bah"] } == data["bah"]
133
+ got_event = true
134
+ end
135
+ subject.encode(event)
136
+ insist { got_event }
137
+ end
138
+
139
+ context "when using custom delimiter" do
140
+ let(:delimiter) { "|" }
141
+ let(:codec_options) { { "delimiter" => delimiter } }
142
+
143
+ it "should decode multiple lines separated by the delimiter" do
144
+ subject.on_event do |e, d|
145
+ insist { d } == "#{LogStash::Event.new(data).to_json}#{delimiter}"
146
+ end
147
+ subject.encode(event)
148
+ end
149
+ end
150
+ end
151
+
152
+ context 'reading from a simulated multiline json file without last newline' do
153
+ let(:input) do
154
+ %{{"field": "value1"}
155
+ {"field": "value2"}}
156
+ end
157
+
158
+ let(:collector) { Array.new }
159
+
160
+ it 'should generate one event' do
161
+ subject.decode(input) do |event|
162
+ collector.push(event)
163
+ end
164
+ expect(collector.size).to eq(1)
165
+ expect(collector.first.get('field')).to eq('value1')
166
+ end
167
+ end
168
+
169
+ context 'reading from a simulated multiline json file with last newline' do
170
+ let(:input) do
171
+ %{{"field": "value1"}
172
+ {"field": "value2"}
173
+ }
174
+ end
175
+
176
+ let(:collector) { Array.new }
177
+
178
+ it 'should generate two events' do
179
+ subject.decode(input) do |event|
180
+ collector.push(event)
181
+ end
182
+ expect(collector.size).to eq(2)
183
+ expect(collector.first.get('field')).to eq('value1')
184
+ expect(collector.last.get('field')).to eq('value2')
185
+ end
186
+ end
187
+
188
+ end
189
+
190
+ context "forcing legacy parsing" do
191
+ it_behaves_like :codec do
192
+ subject do
193
+ # register method is called in the constructor
194
+ LogStash::Codecs::JSONLines.new(codec_options)
195
+ end
196
+
197
+ before(:each) do
198
+ # stub codec parse method to force use of the legacy parser.
199
+ # this is very implementation specific but I am not sure how
200
+ # this can be tested otherwise.
201
+ allow(subject).to receive(:parse) do |line, &block|
202
+ subject.send(:legacy_parse, line, &block)
203
+ end
204
+ end
205
+ end
206
+ end
207
+
208
+ context "default parser choice" do
209
+ # here we cannot force the use of the Event#from_json since if this test is run in the
210
+ # legacy context (no Java Event) it will fail but if in the new context, it will be picked up.
211
+ it_behaves_like :codec do
212
+ subject do
213
+ # register method is called in the constructor
214
+ LogStash::Codecs::JSONLines.new(codec_options)
215
+ end
216
+ end
217
+ end
218
+ end