fluent-plugin-grassland 0.0.4 → 0.0.5
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/README.md +6 -10
 - data/fluent-plugin-grassland.gemspec +1 -1
 - data/lib/fluent/plugin/out_grassland.rb +7 -3
 - 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: daca1a7d14f14e11fda78369ba3896e0bc4436dc
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 9921a442694873ba204ce6fd0267ddb095235f63
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 96f7cae361b8c566da1bbb5a248077609a7c8fbb6eb9982c872bb37ac2d73d40e8ae39f9325f9acb58c242c69ce01854e95f5f50b1bba12542db31fd11d17479
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 6ae0e9fd342cc5ac82fb58e0acbb653fe26541ee1f0466ba49e48e4da8104b8058ac2589ce8cb2b5b4233fba4f4661b1728066198347c8e1447801412b7c09e3
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -82,14 +82,13 @@ $logger = FluentLogger::open("localhost", "24224"); 
     | 
|
| 
       82 
82 
     | 
    
         
             
            /*** ここまでがfluent-logger-php用の前準備 ***/
         
     | 
| 
       83 
83 
     | 
    
         | 
| 
       84 
84 
     | 
    
         
             
            $param = array(
         
     | 
| 
       85 
     | 
    
         
            -
            	'cid' => 'お客様ID',
         
     | 
| 
       86 
85 
     | 
    
         
             
            	'dt' => 'データID',
         
     | 
| 
       87 
     | 
    
         
            -
            	'uid' => 'お客様のサービスのユーザID',
         
     | 
| 
      
 86 
     | 
    
         
            +
            	'uid' => '(optional)お客様のサービスのユーザID',
         
     | 
| 
       88 
87 
     | 
    
         
             
            	'pt' => '(optional)データの発生時刻(ISO 8601準拠の文字列, Ex. "2014-04-01T12:00:00+09:00")',
         
     | 
| 
       89 
88 
     | 
    
         
             
            	'd' => array(
         
     | 
| 
       90 
     | 
    
         
            -
             
     | 
| 
       91 
     | 
    
         
            -
            		'任意のキー' => ' 
     | 
| 
       92 
     | 
    
         
            -
             
     | 
| 
      
 89 
     | 
    
         
            +
                '任意のキー1' => array('任意のキー2' => '集計を行いたいデータ'),
         
     | 
| 
      
 90 
     | 
    
         
            +
            		'(optional)任意のキー1' => array('任意のキー2' => '集計を行いたいデータ'),
         
     | 
| 
      
 91 
     | 
    
         
            +
                ...
         
     | 
| 
       93 
92 
     | 
    
         
             
            	)
         
     | 
| 
       94 
93 
     | 
    
         
             
            );
         
     | 
| 
       95 
94 
     | 
    
         
             
            $logger->post("grassland.data", $param);
         
     | 
| 
         @@ -104,13 +103,10 @@ ptを省略した場合、fluentdが受け付けた時間のUTC時刻として 
     | 
|
| 
       104 
103 
     | 
    
         
             
            date_default_timezone_set('Asia/Tokyo');
         
     | 
| 
       105 
104 
     | 
    
         | 
| 
       106 
105 
     | 
    
         
             
            $param = array(
         
     | 
| 
       107 
     | 
    
         
            -
              'cid' => 'cid0000001',
         
     | 
| 
       108 
106 
     | 
    
         
             
              'dt' => 'd822fab12eeb4db997db87876a082d82',
         
     | 
| 
       109 
     | 
    
         
            -
              'uid' => 'user001',
         
     | 
| 
       110 
     | 
    
         
            -
              'pt' => date( DATE_ISO8601, time() ),
         
     | 
| 
       111 
107 
     | 
    
         
             
              'd' => array(
         
     | 
| 
       112 
     | 
    
         
            -
                'item1' => '100',
         
     | 
| 
       113 
     | 
    
         
            -
                'item2' => '200'
         
     | 
| 
      
 108 
     | 
    
         
            +
                'itemGroup1' => array('item1' => '100'),
         
     | 
| 
      
 109 
     | 
    
         
            +
                'itemGroup1' => array('item2' => '200')
         
     | 
| 
       114 
110 
     | 
    
         
             
              )
         
     | 
| 
       115 
111 
     | 
    
         
             
            );
         
     | 
| 
       116 
112 
     | 
    
         
             
            $logger->post("grassland.data", $param);
         
     | 
| 
         @@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) 
     | 
|
| 
       4 
4 
     | 
    
         | 
| 
       5 
5 
     | 
    
         
             
            Gem::Specification.new do |spec|
         
     | 
| 
       6 
6 
     | 
    
         
             
              spec.name          = 'fluent-plugin-grassland'
         
     | 
| 
       7 
     | 
    
         
            -
              spec.version       = '0.0. 
     | 
| 
      
 7 
     | 
    
         
            +
              spec.version       = '0.0.5'
         
     | 
| 
       8 
8 
     | 
    
         
             
              spec.authors       = ['Ripplation Inc.']
         
     | 
| 
       9 
9 
     | 
    
         
             
              # spec.email         = ['xxxxxx@ripplation.co.jp']
         
     | 
| 
       10 
10 
     | 
    
         
             
              spec.description   = 'Output filter plugin for Grassland'
         
     | 
| 
         @@ -4,7 +4,7 @@ module Fluent 
     | 
|
| 
       4 
4 
     | 
    
         | 
| 
       5 
5 
     | 
    
         
             
                attr_accessor :random
         
     | 
| 
       6 
6 
     | 
    
         
             
                attr_accessor :kinesis
         
     | 
| 
       7 
     | 
    
         
            -
                attr_accessor :stream_name, :access_key_id, :secret_access_key, :region, :sessionToken, :partitionKeys
         
     | 
| 
      
 7 
     | 
    
         
            +
                attr_accessor :id, :stream_name, :access_key_id, :secret_access_key, :region, :sessionToken, :partitionKeys
         
     | 
| 
       8 
8 
     | 
    
         | 
| 
       9 
9 
     | 
    
         
             
                def initialize
         
     | 
| 
       10 
10 
     | 
    
         
             
                  super
         
     | 
| 
         @@ -18,7 +18,7 @@ module Fluent 
     | 
|
| 
       18 
18 
     | 
    
         
             
                end
         
     | 
| 
       19 
19 
     | 
    
         | 
| 
       20 
20 
     | 
    
         
             
                config_param :apiuri,               :string,  :default => 'https://grassland.biz/credentials'
         
     | 
| 
       21 
     | 
    
         
            -
                config_param :id,                  :string,  :default => 'nil'
         
     | 
| 
      
 21 
     | 
    
         
            +
                # config_param :id,                  :string,  :default => 'nil'
         
     | 
| 
       22 
22 
     | 
    
         
             
                config_param :key,                  :string,  :default => 'nil'
         
     | 
| 
       23 
23 
     | 
    
         
             
                config_param :debug,                :bool,    :default => false
         
     | 
| 
       24 
24 
     | 
    
         
             
                config_param :resetCredentialTimer, :integer, :default => 86400
         
     | 
| 
         @@ -72,6 +72,7 @@ module Fluent 
     | 
|
| 
       72 
72 
     | 
    
         | 
| 
       73 
73 
     | 
    
         
             
                def setCredential()
         
     | 
| 
       74 
74 
     | 
    
         
             
                  credential = get_json("#{@apiuri}?key=#{@key}")
         
     | 
| 
      
 75 
     | 
    
         
            +
                  @id = credential['id']
         
     | 
| 
       75 
76 
     | 
    
         
             
                  @stream_name = credential['streamName']
         
     | 
| 
       76 
77 
     | 
    
         
             
                  @access_key_id = credential['accessKeyId']
         
     | 
| 
       77 
78 
     | 
    
         
             
                  @secret_access_key = credential['secretAccessKey']
         
     | 
| 
         @@ -109,7 +110,7 @@ module Fluent 
     | 
|
| 
       109 
110 
     | 
    
         | 
| 
       110 
111 
     | 
    
         
             
                def format(tag, time, record)
         
     | 
| 
       111 
112 
     | 
    
         
             
                  # print(record)
         
     | 
| 
       112 
     | 
    
         
            -
                  ['dt', ' 
     | 
| 
      
 113 
     | 
    
         
            +
                  ['dt', 'd'].each do |key|
         
     | 
| 
       113 
114 
     | 
    
         
             
                    unless record.has_key?(key)
         
     | 
| 
       114 
115 
     | 
    
         
             
                      puts "input data error: '#{key}' is required"
         
     | 
| 
       115 
116 
     | 
    
         
             
                      return ""
         
     | 
| 
         @@ -121,6 +122,9 @@ module Fluent 
     | 
|
| 
       121 
122 
     | 
    
         
             
                  unless record.has_key?('cid')
         
     | 
| 
       122 
123 
     | 
    
         
             
                    record['cid'] = @id
         
     | 
| 
       123 
124 
     | 
    
         
             
                  end
         
     | 
| 
      
 125 
     | 
    
         
            +
                  unless record.has_key?('uid')
         
     | 
| 
      
 126 
     | 
    
         
            +
                    record['uid'] = '0'
         
     | 
| 
      
 127 
     | 
    
         
            +
                  end
         
     | 
| 
       124 
128 
     | 
    
         | 
| 
       125 
129 
     | 
    
         
             
                  record['pk'] = record['cid'] + record['dt']
         
     | 
| 
       126 
130 
     | 
    
         
             
                  return "#{record.to_json},"
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: fluent-plugin-grassland
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.0.5
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Ripplation Inc.
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date:  
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2015-02-06 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: fluentd
         
     |