logstash-codec-excel 0.1.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7e5110f9f285866168ce08286c8d6c405b7f0bf4
4
+ data.tar.gz: ddfa3025c2bf7af6f0165d1f4b30343e47b3ff6b
5
+ SHA512:
6
+ metadata.gz: 6b4b6cb4d1b6ed54e849a54546a662ae4f57573f667e41dc03c97a1a9cdf088524f60b74c87574c064c63cad4ef74ae1c9d48591b8c234b90416d5db42e3d9ab
7
+ data.tar.gz: d72ad1024f0c8ffbc2143636ff27b82b91c4aa1ced8bd255e6290dea91470d1295ae06582f6d407e6cc72a798776af69c19dcb91559431d3e293e05f96e72135
data/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ Gemfile.lock
2
+ .ruby-version
3
+ *.gem
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,13 @@
1
+ Copyright (c) 2012-2014 Elasticsearch <http://www.elasticsearch.org>
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.
data/Rakefile ADDED
@@ -0,0 +1,7 @@
1
+ @files=[]
2
+
3
+ task :default do
4
+ system("rake -T")
5
+ end
6
+
7
+ require "logstash/devutils/rake"
@@ -0,0 +1,43 @@
1
+ require "logstash/codecs/base"
2
+ require "logstash/util/charset"
3
+
4
+ # The "xls" codec is mainly used for xls input
5
+ class LogStash::Codecs::Excel < LogStash::Codecs::Base
6
+ config_name "excel"
7
+
8
+ # The character encoding used in this input. Examples include "UTF-8"
9
+ # and "cp1252"
10
+ #
11
+ # This setting is useful if your log files are in Latin-1 (aka cp1252)
12
+ # or in another character set other than UTF-8.
13
+ #
14
+ # This only affects "plain" format logs since json is UTF-8 already.
15
+ config :charset, :validate => ::Encoding.name_list, :default => "UTF-8"
16
+
17
+ public
18
+ def register
19
+ @converter = LogStash::Util::Charset.new(@charset)
20
+ @converter.logger = @logger
21
+ end
22
+
23
+ public
24
+ def decode(data)
25
+ if data.is_a? Hash
26
+ line = ""
27
+ data[:row].each do |col|
28
+ line << "#{col};"
29
+ end
30
+
31
+ event = LogStash::Event.new("message" => @converter.convert(line.rstrip))
32
+ event.tag("eof") if data[:eof]
33
+ event["wsname"] = data[:wsname]
34
+ end
35
+
36
+ yield event
37
+ end # def decode
38
+
39
+ public
40
+ def encode(event)
41
+ @on_event.call data
42
+ end # def encode
43
+ end # class LogStash::Codecs::Plain
@@ -0,0 +1,27 @@
1
+ Gem::Specification.new do |s|
2
+
3
+ s.name = 'logstash-codec-excel'
4
+ s.version = '0.1.0'
5
+ s.licenses = ['Apache License (2.0)']
6
+ s.summary = "The 'excel' codec is used for xls input and xlsx input"
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"
8
+ s.authors = ["Signify"]
9
+ s.email = 'dietmar@signifydata.com'
10
+ s.homepage = "http://www.signifydata.com"
11
+ s.require_paths = ["lib"]
12
+
13
+ # Files
14
+ s.files = `git ls-files`.split($\)
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', '>= 1.4.0', '< 2.0.0'
24
+
25
+ s.add_development_dependency 'logstash-devutils'
26
+ end
27
+
@@ -0,0 +1,18 @@
1
+ # encoding: utf-8
2
+
3
+ require "logstash/devutils/rspec/spec_helper"
4
+ require "logstash/codecs/line"
5
+ require "logstash/event"
6
+
7
+ describe LogStash::Codecs::Excel do
8
+ subject do
9
+ next LogStash::Codecs::Excel.new
10
+ end
11
+
12
+ context "#encode" do
13
+ let (:event) {LogStash::Event.new({"message" => "hello world", "host" => "test"})}
14
+ end
15
+
16
+ context "#decode" do
17
+ end
18
+ end
metadata ADDED
@@ -0,0 +1,87 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: logstash-codec-excel
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Signify
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-08-25 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: 1.4.0
19
+ - - <
20
+ - !ruby/object:Gem::Version
21
+ version: 2.0.0
22
+ name: logstash-core
23
+ prerelease: false
24
+ type: :runtime
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 1.4.0
30
+ - - <
31
+ - !ruby/object:Gem::Version
32
+ version: 2.0.0
33
+ - !ruby/object:Gem::Dependency
34
+ requirement: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - '>='
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ name: logstash-devutils
40
+ prerelease: false
41
+ type: :development
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - '>='
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ 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
48
+ email: dietmar@signifydata.com
49
+ executables: []
50
+ extensions: []
51
+ extra_rdoc_files: []
52
+ files:
53
+ - .gitignore
54
+ - Gemfile
55
+ - LICENSE
56
+ - Rakefile
57
+ - lib/logstash/codecs/excel.rb
58
+ - logstash-codec-excel.gemspec
59
+ - spec/codecs/excel_spec.rb
60
+ homepage: http://www.signifydata.com
61
+ licenses:
62
+ - Apache License (2.0)
63
+ metadata:
64
+ logstash_plugin: 'true'
65
+ logstash_group: codec
66
+ post_install_message:
67
+ rdoc_options: []
68
+ require_paths:
69
+ - lib
70
+ required_ruby_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - '>='
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ required_rubygems_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - '>='
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ requirements: []
81
+ rubyforge_project:
82
+ rubygems_version: 2.1.9
83
+ signing_key:
84
+ specification_version: 4
85
+ summary: The 'excel' codec is used for xls input and xlsx input
86
+ test_files:
87
+ - spec/codecs/excel_spec.rb