logstash-input-heartbeat 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e08ea34d1ab5ba4b8abafe0fa718b56e425a16c5
4
+ data.tar.gz: 4c9e75428c600a9c12255b1933a4eb29a6c49843
5
+ SHA512:
6
+ metadata.gz: 689519213649da70872e5dc08ad551601bbaf76a6d4e389ae9b17fbe4cf97f87b8d597aa91b582094c298380480a79821990675f4628a071df4d3660e1d72f3b
7
+ data.tar.gz: 3cbf82bdd073d5be14ecc8c4d3dd477653046508d474615201be1986cb4cbddfea366a2a4677e366a370c471eaeea3cc985997f6fc4a78a5607ddae635953f68
data/.gitignore ADDED
@@ -0,0 +1,5 @@
1
+ *.gem
2
+ Gemfile.lock
3
+ Gemfile.bak
4
+ .bundle
5
+ vendor
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
3
+ gem "logstash", :github => "elasticsearch/logstash", :branch => "1.5"
4
+
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/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # Heartbeat
2
+
3
+ This plugin is to aid in monitoring Logstash availability and performance
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "logstash/devutils/rake"
@@ -0,0 +1,66 @@
1
+ # encoding: utf-8
2
+ require "logstash/inputs/threadable"
3
+ require "logstash/namespace"
4
+ require "stud/interval"
5
+ require "socket" # for Socket.gethostname
6
+
7
+ # Generate heartbeat messages.
8
+ #
9
+ # The general intention of this is to test the performance and
10
+ # availability of Logstash.
11
+ #
12
+
13
+ class LogStash::Inputs::Heartbeat < LogStash::Inputs::Threadable
14
+ config_name "heartbeat"
15
+ milestone 1
16
+
17
+ default :codec, "plain"
18
+
19
+ # The message string to use in the event.
20
+ #
21
+ # If you set this to `epoch` then this plugin will use the current
22
+ # timestamp in unix timestamp (which is by definition, UTC). It will
23
+ # output this value into a field called `clock`
24
+ #
25
+ # If you set this to `sequence` then this plugin will send a sequence of
26
+ # numbers beginning at 0 and incrementing each interval. It will
27
+ # output this value into a field called `clock`
28
+ #
29
+ # Otherwise, this value will be used verbatim as the event message. It
30
+ # will output this value into a field called `message`
31
+ config :message, :validate => :string, :default => "ok"
32
+
33
+ # Set how frequently messages should be sent.
34
+ #
35
+ # The default, `60`, means send a message every 60 seconds.
36
+ config :interval, :validate => :number, :default => 60
37
+
38
+ public
39
+ def register
40
+ @host = Socket.gethostname
41
+ end # def register
42
+
43
+ def run(queue)
44
+ sequence = 0
45
+
46
+ Stud.interval(@interval) do
47
+ if @message == "epoch"
48
+ event = LogStash::Event.new("clock" => Time.now.to_i, "host" => @host)
49
+ elsif @message == "sequence"
50
+ event = LogStash::Event.new("clock" => sequence, "host" => @host)
51
+ sequence += 1
52
+ else
53
+ event = LogStash::Event.new("message" => @message, "host" => @host)
54
+ end
55
+
56
+ decorate(event)
57
+ queue << event
58
+
59
+ end # loop
60
+
61
+ end # def run
62
+
63
+ public
64
+ def teardown
65
+ end # def teardown
66
+ end # class LogStash::Inputs::Heartbeat
@@ -0,0 +1,30 @@
1
+ Gem::Specification.new do |s|
2
+
3
+ s.name = 'logstash-input-heartbeat'
4
+ s.version = '0.1.0'
5
+ s.licenses = ['Apache License (2.0)']
6
+ s.summary = "This input generates a heartbeat pattern to aid in monitoring Logstash performance & availability"
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 = ["Elasticsearch"]
9
+ s.email = 'info@elasticsearch.com'
10
+ s.homepage = "http://www.elasticsearch.org/guide/en/logstash/current/index.html"
11
+ s.require_paths = ["lib"]
12
+
13
+ # Files
14
+ s.files = `git ls-files`.split($\)+::Dir.glob('vendor/*')
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" => "input" }
21
+
22
+ # Gem dependencies
23
+ s.add_runtime_dependency 'logstash', '>= 1.4.0', '< 2.0.0'
24
+ s.add_runtime_dependency 'logstash-codec-plain'
25
+ s.add_runtime_dependency 'stud'
26
+
27
+ s.add_development_dependency 'logstash-devutils'
28
+
29
+ end
30
+
@@ -0,0 +1 @@
1
+ require "logstash/devutils/rspec/spec_helper"
metadata ADDED
@@ -0,0 +1,116 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: logstash-input-heartbeat
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Elasticsearch
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-12-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: logstash
15
+ version_requirements: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: 1.4.0
20
+ - - <
21
+ - !ruby/object:Gem::Version
22
+ version: 2.0.0
23
+ requirement: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - '>='
26
+ - !ruby/object:Gem::Version
27
+ version: 1.4.0
28
+ - - <
29
+ - !ruby/object:Gem::Version
30
+ version: 2.0.0
31
+ prerelease: false
32
+ type: :runtime
33
+ - !ruby/object:Gem::Dependency
34
+ name: logstash-codec-plain
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - '>='
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ requirement: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - '>='
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
45
+ prerelease: false
46
+ type: :runtime
47
+ - !ruby/object:Gem::Dependency
48
+ name: stud
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ requirement: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - '>='
57
+ - !ruby/object:Gem::Version
58
+ version: '0'
59
+ prerelease: false
60
+ type: :runtime
61
+ - !ruby/object:Gem::Dependency
62
+ name: logstash-devutils
63
+ version_requirements: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - '>='
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ requirement: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - '>='
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
73
+ prerelease: false
74
+ type: :development
75
+ 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
76
+ email: info@elasticsearch.com
77
+ executables: []
78
+ extensions: []
79
+ extra_rdoc_files: []
80
+ files:
81
+ - .gitignore
82
+ - Gemfile
83
+ - LICENSE
84
+ - README.md
85
+ - Rakefile
86
+ - lib/logstash/inputs/heartbeat.rb
87
+ - logstash-input-heartbeat.gemspec
88
+ - spec/inputs/heartbeat_spec.rb
89
+ homepage: http://www.elasticsearch.org/guide/en/logstash/current/index.html
90
+ licenses:
91
+ - Apache License (2.0)
92
+ metadata:
93
+ logstash_plugin: 'true'
94
+ logstash_group: input
95
+ post_install_message:
96
+ rdoc_options: []
97
+ require_paths:
98
+ - lib
99
+ required_ruby_version: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ required_rubygems_version: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - '>='
107
+ - !ruby/object:Gem::Version
108
+ version: '0'
109
+ requirements: []
110
+ rubyforge_project:
111
+ rubygems_version: 2.1.9
112
+ signing_key:
113
+ specification_version: 4
114
+ summary: This input generates a heartbeat pattern to aid in monitoring Logstash performance & availability
115
+ test_files:
116
+ - spec/inputs/heartbeat_spec.rb