fluent-plugin-logio 1.0.0 → 1.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 +4 -4
 - data/lib/fluent/plugin/out_logio.rb +20 -10
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: a18cdba71a5ce17cd3f89e984e592c5466840e9a
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 3552bc9d312ba920b27e8cb881f2a9617033c7c7
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 54d554fcff12173bd8f7588f50511e6419832c2d57da6587c9d5f8d53e3cee4270e9fe1c53da80f44199a58ec9d3e9293b7ec36605933351bac829635d5b2ed1
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: bec10c75aa9367986da192444d6196437dd5bef6e57c28a80d76987e723e8d4b9d70f3b0b9856a8fffcc0d49456c78ab0117a485e59e4a059664397b572ae2c1
         
     | 
| 
         @@ -1,3 +1,5 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'socket'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
       1 
3 
     | 
    
         
             
            module Fluent
         
     | 
| 
       2 
4 
     | 
    
         | 
| 
       3 
5 
     | 
    
         
             
              class LogioOutput < Output
         
     | 
| 
         @@ -7,12 +9,12 @@ module Fluent 
     | 
|
| 
       7 
9 
     | 
    
         
             
                config_param :output_type, :default => 'json'
         
     | 
| 
       8 
10 
     | 
    
         
             
                config_param :host, :string, :default => 'localhost'
         
     | 
| 
       9 
11 
     | 
    
         
             
                config_param :port, :integer, :default => 28777
         
     | 
| 
       10 
     | 
    
         
            -
             
     | 
| 
       11 
     | 
    
         
            -
                 
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
     | 
    
         
            -
             
     | 
| 
       15 
     | 
    
         
            -
                 
     | 
| 
      
 12 
     | 
    
         
            +
                config_param :node, :string, :default => nil
         
     | 
| 
      
 13 
     | 
    
         
            +
                config_param :stream, :string, :default => nil
         
     | 
| 
      
 14 
     | 
    
         
            +
                config_param :log_level, :string, :default => 'info'
         
     | 
| 
      
 15 
     | 
    
         
            +
                config_param :node_key_name, :string, :default => 'hostname'
         
     | 
| 
      
 16 
     | 
    
         
            +
                config_param :stream_key_name, :string, :default => nil
         
     | 
| 
      
 17 
     | 
    
         
            +
                config_param :log_level_key_name, :string, :default => nil
         
     | 
| 
       16 
18 
     | 
    
         | 
| 
       17 
19 
     | 
    
         
             
                def configure(conf)
         
     | 
| 
       18 
20 
     | 
    
         
             
                  super
         
     | 
| 
         @@ -25,7 +27,7 @@ module Fluent 
     | 
|
| 
       25 
27 
     | 
    
         
             
                  super
         
     | 
| 
       26 
28 
     | 
    
         
             
                  puts @host
         
     | 
| 
       27 
29 
     | 
    
         
             
                  puts @port
         
     | 
| 
       28 
     | 
    
         
            -
                  @socket = TCPSocket.open(@host,  
     | 
| 
      
 30 
     | 
    
         
            +
                  @socket = TCPSocket.open(@host, @port)
         
     | 
| 
       29 
31 
     | 
    
         
             
                end
         
     | 
| 
       30 
32 
     | 
    
         | 
| 
       31 
33 
     | 
    
         
             
                def shutdown
         
     | 
| 
         @@ -35,9 +37,17 @@ module Fluent 
     | 
|
| 
       35 
37 
     | 
    
         
             
                end
         
     | 
| 
       36 
38 
     | 
    
         | 
| 
       37 
39 
     | 
    
         
             
                def emit(tag, es, chain)
         
     | 
| 
       38 
     | 
    
         
            -
                  es.each  
     | 
| 
       39 
     | 
    
         
            -
                    @ 
     | 
| 
       40 
     | 
    
         
            -
             
     | 
| 
      
 40 
     | 
    
         
            +
                  es.each do |time,record|
         
     | 
| 
      
 41 
     | 
    
         
            +
                    stream = @stream ? @stream : tag
         
     | 
| 
      
 42 
     | 
    
         
            +
                    node = @node ? @node : Socket.gethostname
         
     | 
| 
      
 43 
     | 
    
         
            +
                    logLevel = @log_level
         
     | 
| 
      
 44 
     | 
    
         
            +
             
     | 
| 
      
 45 
     | 
    
         
            +
                    stream = (record[@stream_key_name] or stream) if @stream_key_name
         
     | 
| 
      
 46 
     | 
    
         
            +
                    node = (record[@node_key_name] or node) if @node_key_name
         
     | 
| 
      
 47 
     | 
    
         
            +
                    logLevel = (record[@log_level_key_name] or logLevel) if @log_level_key_name
         
     | 
| 
      
 48 
     | 
    
         
            +
             
     | 
| 
      
 49 
     | 
    
         
            +
                    @socket.puts "+log|#{stream}|#{node}|#{logLevel}|#{@formatter.format(tag, time, record).chomp}\r\n"
         
     | 
| 
      
 50 
     | 
    
         
            +
                  end
         
     | 
| 
       41 
51 
     | 
    
         | 
| 
       42 
52 
     | 
    
         
             
                  chain.next
         
     | 
| 
       43 
53 
     | 
    
         
             
                rescue => e
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: fluent-plugin-logio
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.1.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Black Roland
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2016- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2016-06-25 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies: []
         
     | 
| 
       13 
13 
     | 
    
         
             
            description: Log.io output plugin for Fluentd
         
     | 
| 
       14 
14 
     | 
    
         
             
            email: 
         
     |