logstash-output-faye 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 +7 -0
- data/.gitignore +3 -0
- data/Gemfile +2 -0
- data/LICENSE +13 -0
- data/Rakefile +7 -0
- data/lib/logstash/outputs/faye.rb +60 -0
- data/logstash-output-faye.gemspec +27 -0
- data/spec/outputs/faye_spec.rb +5 -0
- metadata +87 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c05f23c88bc485d310a589b4e135adfe27d1e8b1
|
4
|
+
data.tar.gz: b222265b42dedd89b40de05ab2d9c9d24be1ee73
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e16ccb053a4cdadc89cba85db27e9a96d3dc06a225b5ef792d463390e162b277025628df635d754dbf199505730b0abc71d0594e9e0df098a628f3589bb41de5
|
7
|
+
data.tar.gz: 3f1b676e7c0da109cc6dde66cea9ab8b92ed06ffe76f8d3fcdd9b198957498b399e3eef32ef73a92370755fe125fea56a0dea7cc9c71529eddaad49db2349530
|
data/.gitignore
ADDED
data/Gemfile
ADDED
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,60 @@
|
|
1
|
+
require "logstash/namespace"
|
2
|
+
require "logstash/outputs/base"
|
3
|
+
require 'json'
|
4
|
+
|
5
|
+
# File output.
|
6
|
+
#
|
7
|
+
# Write events to files on disk. You can use fields from the
|
8
|
+
# event as parts of the filename.
|
9
|
+
class LogStash::Outputs::Faye < LogStash::Outputs::Base
|
10
|
+
|
11
|
+
config_name "faye"
|
12
|
+
|
13
|
+
# Faye-channel on to be sent on
|
14
|
+
config :channel, :validate => :string
|
15
|
+
|
16
|
+
# Faye-security-token
|
17
|
+
config :faye_token, :validate => :string
|
18
|
+
|
19
|
+
# Url of the faye-server
|
20
|
+
config :faye_url, :validate => :string, :default => "http://localhost:9292/faye"
|
21
|
+
|
22
|
+
public
|
23
|
+
def register
|
24
|
+
require "net/http"
|
25
|
+
end # def register
|
26
|
+
|
27
|
+
public
|
28
|
+
def receive(event)
|
29
|
+
return unless output?(event)
|
30
|
+
|
31
|
+
_send_message event
|
32
|
+
end # def receive
|
33
|
+
|
34
|
+
private
|
35
|
+
def _send_message(data)
|
36
|
+
if @faye_token
|
37
|
+
message = {:channel => @channel, :data => data, :ext => {:auth_token => @faye_token}}
|
38
|
+
else
|
39
|
+
message = {:channel => @channel, :data => data}
|
40
|
+
end
|
41
|
+
|
42
|
+
uri = URI.parse(@faye_url)
|
43
|
+
res = Net::HTTP.post_form(uri, :message => message.to_json)
|
44
|
+
|
45
|
+
if res.is_a?(Net::HTTPSuccess)
|
46
|
+
message = JSON.parse(res.body)
|
47
|
+
|
48
|
+
@logger.warn("Faye request was not successfully", message.first) unless message.first['successful']
|
49
|
+
else
|
50
|
+
@logger.warn("Faye response not ok", :http_status => res.code, :message => res.message)
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
|
55
|
+
def teardown
|
56
|
+
finished
|
57
|
+
end
|
58
|
+
end # class LogStash::Outputs::Faye
|
59
|
+
|
60
|
+
|
@@ -0,0 +1,27 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
|
3
|
+
s.name = 'logstash-output-faye'
|
4
|
+
s.version = '0.1.0'
|
5
|
+
s.licenses = ['Apache License (2.0)']
|
6
|
+
s.summary = "Send event to faye-message-server"
|
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" => "output" }
|
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
|
+
|
metadata
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: logstash-output-faye
|
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/outputs/faye.rb
|
58
|
+
- logstash-output-faye.gemspec
|
59
|
+
- spec/outputs/faye_spec.rb
|
60
|
+
homepage: http://www.signifydata.com
|
61
|
+
licenses:
|
62
|
+
- Apache License (2.0)
|
63
|
+
metadata:
|
64
|
+
logstash_plugin: 'true'
|
65
|
+
logstash_group: output
|
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: Send event to faye-message-server
|
86
|
+
test_files:
|
87
|
+
- spec/outputs/faye_spec.rb
|