logstash-filter-fix_protocol 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d64ca3007060cbec2236752969bc46c77b81b011
4
- data.tar.gz: f03c1e3cd153ddf7dbae4705d3e894cc1cf5fdbb
3
+ metadata.gz: d2ab5f7e044aaeec1772eac93f6cdcc0a7b3b244
4
+ data.tar.gz: 64d0fb4501b0f248a6c6c27b209a1233974a9810
5
5
  SHA512:
6
- metadata.gz: aee628efe7b15084e5e9c1043246b9e7199ed984226df25ddbb8d8a61e4bc261a91a5c2017d31c67709c9db7d8af817d868af00e9e1fdb479b1af2b4ed812ae2
7
- data.tar.gz: 37e8bba116e19bd4a7a507cdebb194ef85cace4b4d0f0abba396f1ac4d902828fd5c3e2ea291fea0c418347efbe05d8635a617fc2057564ffefbddd0179b5467
6
+ metadata.gz: 964dd92d25e2e7705a6e4e3ebebd069dd146c7094d94396ac860bcf584c38511e1d33a78b6f6e6b29abb1776f31630c382b134c440351ed2a09def9606605981
7
+ data.tar.gz: 9f8aa82f8e7f7a4735a1f5d3b6668a6e90f227a779c70f1c2a0610cc7bf069b92bce8eb00a7488f70fee06023f6257a6a5d896c0f7f4988ef197983f37e0e62e
data/README.md CHANGED
@@ -108,6 +108,36 @@ To release a new version, update the **version number** in `logstash-filter-fix_
108
108
  $ ./bin/rspec rspec
109
109
  ```
110
110
 
111
+ ### Logstash 2x vs 5x
112
+
113
+ Remove any installed versions of logstash and install your desired version.
114
+
115
+ After you've completed the 'Manual change' or 'Ansible provisioning change' below, follow instructions for 'Development Logstash Installation'
116
+
117
+ #### Manual change:
118
+
119
+ Change the version number in `lib/logstash/filters/version.rb`
120
+
121
+ ```ruby
122
+ module Logstash
123
+ VERSION = '2.x'
124
+ end
125
+ ```
126
+
127
+ #### Ansible provisioning change:
128
+
129
+ Change the version number in `provision/group_vars/all.yml`
130
+
131
+ ```yml
132
+ logstash_version: 5.x # -> 2.x
133
+ ```
134
+
135
+ Run vagrant provision:
136
+
137
+ ```
138
+ vagrant provision
139
+ ```
140
+
111
141
  ### Development Logstash Installation
112
142
 
113
143
  1. Add the filter to your installation of LogStash
@@ -0,0 +1,11 @@
1
+
2
+ # monkey-patch deprecated breaking change from 5x
3
+ class LogStash::Event
4
+ def [](key)
5
+ respond_to?(:get) ? get(key) : super(key)
6
+ end
7
+
8
+ def []=(key, val)
9
+ respond_to?(:set) ? set(key, val) : super(key, val)
10
+ end
11
+ end
@@ -5,11 +5,12 @@ require "logstash/filters/data_dictionary"
5
5
  require "logstash/filters/fix_message"
6
6
  require 'active_support'
7
7
  require 'active_support/core_ext'
8
+ # monkey-patching breaking 5x behavior
9
+ require 'logstash/filters/extensions/event'
8
10
 
9
11
  module LogStash
10
12
  module Filters
11
13
  class FixProtocol < LogStash::Filters::Base
12
-
13
14
  attr_reader :data_dictionary, :session_dictionary
14
15
 
15
16
  config_name "fix_protocol"
@@ -0,0 +1,3 @@
1
+ module Logstash
2
+ VERSION = '5.x'
3
+ end
@@ -1,10 +1,11 @@
1
1
  # coding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'logstash/filters/version'
4
5
 
5
6
  Gem::Specification.new do |s|
6
7
  s.name = "logstash-filter-fix_protocol"
7
- s.version = "0.2.1"
8
+ s.version = "0.3.0"
8
9
  s.authors = ["Connamara Systems"]
9
10
  s.email = ["info@connamara.com"]
10
11
 
@@ -21,7 +22,13 @@ Gem::Specification.new do |s|
21
22
 
22
23
  s.metadata = { "logstash_plugin" => "true", "logstash_group" => "filter" }
23
24
 
24
- s.add_runtime_dependency "logstash-core", ">= 2.0.0.beta2", "< 3.0.0"
25
+ if Logstash::VERSION == '5.x'
26
+ s.add_runtime_dependency 'logstash-core', '>= 5.0.0'
27
+ elsif Logstash::VERSION == '2.x'
28
+ s.add_runtime_dependency 'logstash-core', '>= 2.0.0.beta2', '< 3.0.0'
29
+ else
30
+ raise "Invalid Logstash::VERSION - should be 2x or 5x located in `/lib/logstash/filters/version`"
31
+ end
25
32
  s.add_runtime_dependency "logstash-input-generator"
26
33
  s.add_runtime_dependency "activesupport"
27
34
  s.add_runtime_dependency "quickfix-jruby"
@@ -1,3 +1,3 @@
1
- require 'logstash/filters/fix_protocol'
2
1
  require "logstash/devutils/rspec/spec_helper"
2
+ require 'logstash/filters/fix_protocol'
3
3
 
metadata CHANGED
@@ -1,24 +1,21 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-filter-fix_protocol
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Connamara Systems
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-11 00:00:00.000000000 Z
11
+ date: 2017-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
16
  - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: 2.0.0.beta2
19
- - - "<"
20
- - !ruby/object:Gem::Version
21
- version: 3.0.0
18
+ version: 5.0.0
22
19
  name: logstash-core
23
20
  prerelease: false
24
21
  type: :runtime
@@ -26,10 +23,7 @@ dependencies:
26
23
  requirements:
27
24
  - - ">="
28
25
  - !ruby/object:Gem::Version
29
- version: 2.0.0.beta2
30
- - - "<"
31
- - !ruby/object:Gem::Version
32
- version: 3.0.0
26
+ version: 5.0.0
33
27
  - !ruby/object:Gem::Dependency
34
28
  requirement: !ruby/object:Gem::Requirement
35
29
  requirements:
@@ -156,8 +150,10 @@ files:
156
150
  - QUICKFIX_LICENSE.txt
157
151
  - README.md
158
152
  - lib/logstash/filters/data_dictionary.rb
153
+ - lib/logstash/filters/extensions/event.rb
159
154
  - lib/logstash/filters/fix_message.rb
160
155
  - lib/logstash/filters/fix_protocol.rb
156
+ - lib/logstash/filters/version.rb
161
157
  - logstash-filter-fix_protocol.gemspec
162
158
  - spec/filters/fix_message_spec.rb
163
159
  - spec/filters/fix_protocol_spec.rb