fluent-plugin-logio 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/fluent/plugin/out_logio.rb +48 -0
  3. metadata +44 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 75fd33b351a950046f2eaeb97fb0f4f0d771652a
4
+ data.tar.gz: a242991f239a7f18b92b385e580a8be826b943d6
5
+ SHA512:
6
+ metadata.gz: d6adbbeba2687fcfacb733dd6383d5408b66d6efdc1142a0e8d9904faa3edd0fceb4738d6cb84ec44da55d23af1629265683586357fc8d8318cd8684fe0f9a35
7
+ data.tar.gz: b9774af90e1fa57ff636d4adeb46dd43d4dda542dc8653f7f83d77b86de94c2b4eb36d5a7637e8ebf8b94a71a2f29a9863e690a96d142b06d924fb563674ed3e
@@ -0,0 +1,48 @@
1
+ module Fluent
2
+
3
+ class LogioOutput < Output
4
+
5
+ Plugin.register_output('logio', self)
6
+
7
+ config_param :output_type, :default => 'json'
8
+ config_param :host, :string, :default => 'localhost'
9
+ config_param :port, :integer, :default => 28777
10
+
11
+ def initialize
12
+ super
13
+
14
+ require 'socket'
15
+ end
16
+
17
+ def configure(conf)
18
+ super
19
+
20
+ @formatter = Plugin.new_formatter(@output_type)
21
+ @formatter.configure(conf)
22
+ end
23
+
24
+ def start
25
+ super
26
+ puts @host
27
+ puts @port
28
+ @socket = TCPSocket.open(@host, 28777)
29
+ end
30
+
31
+ def shutdown
32
+ super
33
+
34
+ @socket.close
35
+ end
36
+
37
+ def emit(tag, es, chain)
38
+ es.each {|time,record|
39
+ @socket.puts "+log|#{tag}|#{record[:hostname] or Socket.gethostname}||#{@formatter.format(tag, time, record).chomp}\r\n"
40
+ }
41
+
42
+ chain.next
43
+ rescue => e
44
+ log.error "emit", :error_class => e.class, :error => e.to_s
45
+ log.error_backtrace
46
+ end
47
+ end
48
+ end
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fluent-plugin-logio
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Black Roland
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-05-12 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Log.io output plugin for Fluentd
14
+ email:
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/fluent/plugin/out_logio.rb
20
+ homepage: https://github.com/black-roland/fluent-plugin-logio
21
+ licenses:
22
+ - MIT
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubyforge_project:
40
+ rubygems_version: 2.4.8
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: Fluentd Log.io plugin
44
+ test_files: []