fluent-plugin-relp 0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +55 -0
- data/fluent-plugin-relp.gemspec +22 -0
- data/lib/fluent/plugin/in_relp.rb +46 -0
- metadata +91 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 42bd594220592ca36e93291bc9e25683d4a687db
|
4
|
+
data.tar.gz: a425a468debd7c4ee3af5624ad5c30f008085b5e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d5067ec0698f83453a7f797ed1bfa0b7a0165158b395d8ef505705a7afb7a3d6788d70f05ec6d1277075482a48c81c7351f5ca5779e6503c37395f1490f0da3f
|
7
|
+
data.tar.gz: a3c9422a78ffe71d5220932e74ccb3d043aabc09a3716f6ed04409ec8c89fef7fc3b563cc61c8ace83c3abc953aaf0329dc0c7f96e2d6516d9f533ff677ae92d
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 dhlavac
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
# RELP input plugin
|
2
|
+
|
3
|
+
Plugin for input to fluentd using [RELP protocol](http://www.rsyslog.com/doc/relp.html)
|
4
|
+
|
5
|
+
this depends on `relp` ruby gem which host server-side ruby implementation
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'fluent-plugin-relp'
|
13
|
+
```
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install fluent-plugin-relp
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
To use the plugin just add tou your fluent.conf file:
|
22
|
+
```aconf
|
23
|
+
<source>
|
24
|
+
@type relp
|
25
|
+
#optionally, specify port on which to start relp server, defaults to 5170
|
26
|
+
port XXXX
|
27
|
+
#optionally, specify a tag with which to mark messages received over this connection
|
28
|
+
tag remote
|
29
|
+
#optionally, determine remote IP to bind to, by default binds to all incoming connections
|
30
|
+
bind XX.XX.XX.XX
|
31
|
+
</source>
|
32
|
+
|
33
|
+
```
|
34
|
+
With the above set up your fluentd is ready to accept messages transported by RELP, for example logs
|
35
|
+
sent by rsyslog's `omrelp` module, example of setting up (/etc/rsyslog.conf file):
|
36
|
+
|
37
|
+
```aconf
|
38
|
+
module(load="omrelp")
|
39
|
+
|
40
|
+
*.* (action="omrelp",
|
41
|
+
Target="your_fluentd_host_or_ip"
|
42
|
+
Port="5170_or_yours_set"
|
43
|
+
Protocol="tcp")
|
44
|
+
```
|
45
|
+
|
46
|
+
That is all you need to reliably send system logs to remote fluentd instance.
|
47
|
+
|
48
|
+
## Contributing
|
49
|
+
|
50
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/ViaQ/fluent-plugin-relp.
|
51
|
+
|
52
|
+
|
53
|
+
## License
|
54
|
+
|
55
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
Gem::Specification.new do |gem|
|
3
|
+
gem.name = "fluent-plugin-relp"
|
4
|
+
gem.version = "0.1"
|
5
|
+
gem.authors = ["Jiří Vymazal"]
|
6
|
+
gem.email = ["jvymazal@redhat.com"]
|
7
|
+
gem.summary = %q{Fluent plugin to receive messages via RELP}
|
8
|
+
gem.description = %q{Plugin allowing recieving log messages via RELP protocol from e.g. syslog}
|
9
|
+
gem.homepage = "https://github.com/ViaQ/fluent-plugin-relp"
|
10
|
+
gem.license = "MIT"
|
11
|
+
|
12
|
+
gem.files = `git ls-files`.split($\)
|
13
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
14
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
15
|
+
gem.require_paths = ["lib"]
|
16
|
+
|
17
|
+
gem.required_ruby_version = '>= 2.0.0'
|
18
|
+
|
19
|
+
gem.add_development_dependency 'rake', '~> 0'
|
20
|
+
gem.add_runtime_dependency 'fluentd', '~> 0'
|
21
|
+
gem.add_runtime_dependency 'relp', '~> 0.0'
|
22
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require 'fluent/input'
|
2
|
+
require 'relp'
|
3
|
+
|
4
|
+
module Fluent
|
5
|
+
class RelpInput < Input
|
6
|
+
Fluent::Plugin.register_input('relp', self)
|
7
|
+
|
8
|
+
desc 'Tag of output events.'
|
9
|
+
config_param :tag, :string
|
10
|
+
desc 'The port to listen to.'
|
11
|
+
config_param :port, :integer, default: 5170
|
12
|
+
desc 'The bind address to listen to.'
|
13
|
+
config_param :bind, :string, default: '0.0.0.0'
|
14
|
+
|
15
|
+
def configure(conf)
|
16
|
+
super
|
17
|
+
end
|
18
|
+
|
19
|
+
def start
|
20
|
+
@server = Relp::RelpServer.new(@bind, @port, log, method(:on_message))
|
21
|
+
@thread = Thread.new(&method(:run))
|
22
|
+
end
|
23
|
+
|
24
|
+
def shutdown
|
25
|
+
super
|
26
|
+
@server.server_shut_down
|
27
|
+
@thread.join
|
28
|
+
end
|
29
|
+
|
30
|
+
def run
|
31
|
+
@server.run()
|
32
|
+
rescue => e
|
33
|
+
log.error "unexpected error", error: e, error_class: e.class
|
34
|
+
log.error_backtrace
|
35
|
+
end
|
36
|
+
|
37
|
+
def on_message(msg)
|
38
|
+
time = Engine.now
|
39
|
+
router.emit(@tag, time, msg.dump)
|
40
|
+
rescue => e
|
41
|
+
log.error msg.dump, error: e, error_class: e.class
|
42
|
+
log.error_backtrace
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
metadata
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fluent-plugin-relp
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '0.1'
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jiří Vymazal
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-06-21 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rake
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: fluentd
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: relp
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.0'
|
55
|
+
description: Plugin allowing recieving log messages via RELP protocol from e.g. syslog
|
56
|
+
email:
|
57
|
+
- jvymazal@redhat.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- Gemfile
|
63
|
+
- LICENSE.txt
|
64
|
+
- README.md
|
65
|
+
- fluent-plugin-relp.gemspec
|
66
|
+
- lib/fluent/plugin/in_relp.rb
|
67
|
+
homepage: https://github.com/ViaQ/fluent-plugin-relp
|
68
|
+
licenses:
|
69
|
+
- MIT
|
70
|
+
metadata: {}
|
71
|
+
post_install_message:
|
72
|
+
rdoc_options: []
|
73
|
+
require_paths:
|
74
|
+
- lib
|
75
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
76
|
+
requirements:
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: 2.0.0
|
80
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '0'
|
85
|
+
requirements: []
|
86
|
+
rubyforge_project:
|
87
|
+
rubygems_version: 2.5.2
|
88
|
+
signing_key:
|
89
|
+
specification_version: 4
|
90
|
+
summary: Fluent plugin to receive messages via RELP
|
91
|
+
test_files: []
|