logstash-codec-influxdb 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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 0e2a4db2d8780f08239250dbc1cc6fbe776838e8ca3bb409e8d0aa637ce4092f
4
+ data.tar.gz: 4fcc417bc15bcf0bf2a3fcf3ca7d713de57e7d02afcaf1d67840118d16acf65f
5
+ SHA512:
6
+ metadata.gz: 0a796f8db3f5ed0bfa80fa024f0f46549eefc7555a755ff578c5d725c028eb360233baa5ca1316edbde9294b9bbdf9638b4fa9d47130e004a086c76aa0c0e17f
7
+ data.tar.gz: 61ed61db219aac58e76089f30fe8f6357ad9a5327622b7ebf760a0d720a462656b0821945f250b6593258fc902133441dc7e6e4caa94968461566df900865139
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
3
+ gem "logstash", :github => "elastic/logstash", :branch => "6.8"
data/LICENSE ADDED
@@ -0,0 +1,13 @@
1
+ Copyright (c) 2012-2015 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.
@@ -0,0 +1,2 @@
1
+ # logstash-codec-example
2
+ Example codec plugin. This should help bootstrap your effort to write your own codec plugin!
@@ -0,0 +1,44 @@
1
+ # encoding: utf-8
2
+ require "logstash/codecs/base"
3
+ require "logstash/codecs/line"
4
+ require "influxparser"
5
+ # Add any asciidoc formatted documentation here
6
+ class LogStash::Codecs::Influxdb < LogStash::Codecs::Base
7
+
8
+ # input {
9
+ # stdin { codec => influxdb { } }
10
+ # }
11
+ #
12
+ # or
13
+ #
14
+ # output {
15
+ # stdout { codec => influxdb { } }
16
+ # }
17
+ config_name "influxdb"
18
+
19
+ # Append a string to the message
20
+ config :append, :validate => :string, :default => ', Hello World!'
21
+
22
+ public
23
+ def register
24
+ @lines = LogStash::Codecs::Line.new
25
+ @lines.charset = "UTF-8"
26
+ end
27
+
28
+ public
29
+ def decode(data)
30
+ @lines.decode(data) do |line|
31
+ # replace = { "message" => line.get("message").to_s + @append }
32
+ # yield LogStash::Event.new(replace)
33
+ yield LogStash::Event.new(InfluxParser.parse_point(line.get("message")))
34
+ end
35
+ end # def decode
36
+
37
+ public
38
+ def encode(event)
39
+ # @on_event.call(event, event.get("message").to_s + @append + NL)
40
+ # there is no encode (maybe some day)
41
+ yield event
42
+ end # def encode
43
+
44
+ end # class LogStash::Codecs::Influxdb
@@ -0,0 +1,24 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = 'logstash-codec-influxdb'
3
+ s.version = '0.1.0'
4
+ s.licenses = ['Apache License (2.0)']
5
+ s.summary = "Decodes InfluxDB line protocol"
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 = ["Robert Labrie"]
8
+ s.email = 'robert.labrie@gmail.com'
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" => "codec" }
19
+
20
+ # Gem dependencies
21
+ s.add_runtime_dependency "logstash-core-plugin-api", ">= 1.60", "<= 2.99"
22
+ s.add_runtime_dependency "influxparser", ">=0.0.1"
23
+ s.add_development_dependency 'logstash-devutils'
24
+ end
@@ -0,0 +1 @@
1
+ require "logstash/devutils/rspec/spec_helper"
metadata ADDED
@@ -0,0 +1,101 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: logstash-codec-influxdb
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Robert Labrie
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-01-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: logstash-core-plugin-api
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '1.60'
20
+ - - "<="
21
+ - !ruby/object:Gem::Version
22
+ version: '2.99'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '1.60'
30
+ - - "<="
31
+ - !ruby/object:Gem::Version
32
+ version: '2.99'
33
+ - !ruby/object:Gem::Dependency
34
+ name: influxparser
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: 0.0.1
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 0.0.1
47
+ - !ruby/object:Gem::Dependency
48
+ name: logstash-devutils
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ description: This gem is a logstash plugin required to be installed on top of the
62
+ Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This
63
+ gem is not a stand-alone program
64
+ email: robert.labrie@gmail.com
65
+ executables: []
66
+ extensions: []
67
+ extra_rdoc_files: []
68
+ files:
69
+ - Gemfile
70
+ - LICENSE
71
+ - README.md
72
+ - lib/logstash/codecs/influxdb.rb
73
+ - logstash-codec-influxdb.gemspec
74
+ - spec/codecs/example_spec.rb
75
+ homepage: http://www.elastic.co/guide/en/logstash/current/index.html
76
+ licenses:
77
+ - Apache License (2.0)
78
+ metadata:
79
+ logstash_plugin: 'true'
80
+ logstash_group: codec
81
+ post_install_message:
82
+ rdoc_options: []
83
+ require_paths:
84
+ - lib
85
+ required_ruby_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ required_rubygems_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ requirements: []
96
+ rubygems_version: 3.0.6
97
+ signing_key:
98
+ specification_version: 4
99
+ summary: Decodes InfluxDB line protocol
100
+ test_files:
101
+ - spec/codecs/example_spec.rb