logstash-codec-thrift 0.1.0 → 0.1.1

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: ee6ee6cc8ec8d720b7910442c5ed7dc8a440742c
4
- data.tar.gz: b02e5490937476c9eb152c2fcd78b0e6c7b8c89d
3
+ metadata.gz: 5296aade4ca3e73022f68e2dec20878b0f98c0ba
4
+ data.tar.gz: e0ee87e0bee2d7c14383c4a1513e092feb7bcf4b
5
5
  SHA512:
6
- metadata.gz: 6a418f2bf9254f31b4160305dfec168c3689135f1b300183524623f99743ea7c343669306f8d0fa4f24307f4686314bfb7a8f28fb53bf1e886b786f610bac434
7
- data.tar.gz: 22e46011821616d46eea3de80bb7165dcd454bf58ddcc2ec47f09de3b0a3974ca056b31ccad8d27826d439193fc46cb051f92f2b5e261e1db37c4dc4385ed32b
6
+ metadata.gz: 026069b655a339cd6eb1bff80dcfaa34360032a15000d29a1d41bd62d8e0465a2f61f450518c84839d20e2e1248de54eb7cf8ec8291346f4db052edb62f73839
7
+ data.tar.gz: b090666f086672e7a8b1e01288604650ff5901bbc52b22255940d682e53648efda41fe2472be3136483a1c3993d77fcf9ed6afb430076be16296e9bc4152a104
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Logstash Codec Thrift
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/logstash-codec-thrift.svg)](http://badge.fury.io/rb/logstash-codec-thrift)
4
+
3
5
  ## Install
4
6
 
5
7
  $ ./bin/plugin install logstash-codec-thrift
@@ -1,8 +1,7 @@
1
1
  # encoding: utf-8
2
+ require "json"
2
3
  require "logger"
3
4
  require "logstash/codecs/base"
4
- require "logstash/namespace"
5
- require "logstash/timestamp"
6
5
  require "thrift"
7
6
  require "logstash/codecs/thrift-event"
8
7
 
@@ -86,23 +85,21 @@ class LogStash::Codecs::Thrift < LogStash::Codecs::Base
86
85
 
87
86
  private
88
87
  def as_hash(obj)
89
- hash = {}
90
- obj.instance_variables.each { |var|
91
- key = var.to_s.delete("@")
92
- value = obj.instance_variable_get(var)
93
- if value.is_a?(Array)
94
- hash[key] = []
95
- value.each do |elem|
96
- if elem.is_a?(Array) || elem.is_a?(Object)
97
- hash[key].push(as_hash(elem))
98
- else
99
- hash[key].push(elem)
100
- end
101
- end
102
- else
103
- hash[key] = value
104
- end
105
- }
88
+ if obj.is_a?(TrueClass) | obj.is_a?(FalseClass) | obj.is_a?(String) | obj.is_a?(Numeric)
89
+ hash = obj
90
+ elsif obj.is_a?(Array)
91
+ hash = []
92
+ obj.each { |var|
93
+ hash.push(as_hash(var))
94
+ }
95
+ else
96
+ hash = {}
97
+ obj.instance_variables.each { |var|
98
+ key = var.to_s.delete("@")
99
+ value = obj.instance_variable_get(var)
100
+ hash[key] = as_hash(value)
101
+ }
102
+ end
106
103
  hash
107
104
  end
108
105
 
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-codec-thrift'
4
- s.version = '0.1.0'
4
+ s.version = '0.1.1'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "This example input streams a string at a definable interval."
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"
metadata CHANGED
@@ -1,61 +1,61 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-codec-thrift
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Active Agent AG
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-19 00:00:00.000000000 Z
11
+ date: 2015-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logstash-core
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: 1.4.0
20
- - - "<"
20
+ - - <
21
21
  - !ruby/object:Gem::Version
22
22
  version: 2.0.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - ">="
27
+ - - '>='
28
28
  - !ruby/object:Gem::Version
29
29
  version: 1.4.0
30
- - - "<"
30
+ - - <
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.0.0
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: thrift
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - ">="
37
+ - - '>='
38
38
  - !ruby/object:Gem::Version
39
39
  version: '0'
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - ">="
44
+ - - '>='
45
45
  - !ruby/object:Gem::Version
46
46
  version: '0'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: logstash-devutils
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - ">="
51
+ - - '>='
52
52
  - !ruby/object:Gem::Version
53
53
  version: 0.0.15
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - ">="
58
+ - - '>='
59
59
  - !ruby/object:Gem::Version
60
60
  version: 0.0.15
61
61
  description: This gem is a logstash plugin required to be installed on top of the
@@ -66,7 +66,7 @@ executables: []
66
66
  extensions: []
67
67
  extra_rdoc_files: []
68
68
  files:
69
- - ".gitignore"
69
+ - .gitignore
70
70
  - Gemfile
71
71
  - README.md
72
72
  - Rakefile
@@ -86,17 +86,17 @@ require_paths:
86
86
  - lib
87
87
  required_ruby_version: !ruby/object:Gem::Requirement
88
88
  requirements:
89
- - - ">="
89
+ - - '>='
90
90
  - !ruby/object:Gem::Version
91
91
  version: '0'
92
92
  required_rubygems_version: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - '>='
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  requirements: []
98
98
  rubyforge_project:
99
- rubygems_version: 2.4.5
99
+ rubygems_version: 2.0.14
100
100
  signing_key:
101
101
  specification_version: 4
102
102
  summary: This example input streams a string at a definable interval.