fluent-plugin-grassland 0.0.5 → 0.0.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: daca1a7d14f14e11fda78369ba3896e0bc4436dc
4
- data.tar.gz: 9921a442694873ba204ce6fd0267ddb095235f63
3
+ metadata.gz: a5965d01709a896f2109139d95e3bb7e803c0f0c
4
+ data.tar.gz: 5f20d3e34088c39967cc669f9f8dc732a96a9647
5
5
  SHA512:
6
- metadata.gz: 96f7cae361b8c566da1bbb5a248077609a7c8fbb6eb9982c872bb37ac2d73d40e8ae39f9325f9acb58c242c69ce01854e95f5f50b1bba12542db31fd11d17479
7
- data.tar.gz: 6ae0e9fd342cc5ac82fb58e0acbb653fe26541ee1f0466ba49e48e4da8104b8058ac2589ce8cb2b5b4233fba4f4661b1728066198347c8e1447801412b7c09e3
6
+ metadata.gz: 62d4959cb163ed78fb6fc790eb57aa4a7965670706cbdcc6facb772098992a54867d7e4f7d7bdb662640eaca26e19b2031f30413944226fb4a0a74b221a87cf1
7
+ data.tar.gz: 30f1c5614893c73c28cfbe14de3bfeeb0eb3d69db77b45b2a50eabe1aa9636bc05b6dbe2ba092e5d606e8e974a7cb699619e3baca8f4dfde6a5352423d856992
data/README.md CHANGED
@@ -34,6 +34,8 @@ fluent-gemでインストールします。
34
34
  注意: fluent-gemのパスは環境によって異なります。
35
35
 
36
36
  $ /usr/lib64/fluent/ruby/bin/fluent-gem install fluent-plugin-grassland
37
+ または、
38
+ $ /opt/td-agent/embedded/bin/fluent-gem install fluent-plugin-grassland
37
39
 
38
40
  ## Usage
39
41
 
@@ -49,7 +51,7 @@ __Fluentdの設定ファイルに以下を追記します。__
49
51
  <match grassland.**>
50
52
  type grassland
51
53
  key xxxxxxxxxxxxxxxx
52
- flush_interval 3
54
+ flush_interval 5
53
55
  </match>
54
56
  ```
55
57
 
@@ -58,7 +60,7 @@ __Fluentdの設定ファイルに以下を追記します。__
58
60
 
59
61
  __1. [fluent-logger-phpをインストール](https://github.com/fluent/fluent-logger-php)して下さい。__
60
62
  ```
61
- cat >> composer.json << EOF
63
+ cat > composer.json << EOF
62
64
  {
63
65
  "require": {
64
66
  "fluent/logger": "v0.3.7"
@@ -93,7 +95,7 @@ $param = array(
93
95
  );
94
96
  $logger->post("grassland.data", $param);
95
97
  ```
96
-
98
+
97
99
  ptを省略した場合、fluentdが受け付けた時間のUTC時刻として入力されます。
98
100
  「任意のキー」は、グラフに表示される一つの要素になります。
99
101
  例を以下に示します。
@@ -110,4 +112,43 @@ $param = array(
110
112
  )
111
113
  );
112
114
  $logger->post("grassland.data", $param);
115
+ ```
116
+
117
+ ### Node.js usage
118
+
119
+ __1. [fluent-logger-nodeをインストール](https://github.com/fluent/fluent-logger-node)して下さい。__
120
+ ```
121
+ cat > package.json << EOF
122
+ {
123
+ "name": "grassland_test ",
124
+ "version": "0.0.1",
125
+ "dependencies": {
126
+ "fluent-logger": "0.2.6"
127
+ }
128
+ }
129
+ EOF
130
+ npm install
131
+ ```
132
+
133
+ __2. 実際にPHPに記載して下さい。__
134
+ ```
135
+ var logger = require('fluent-logger');
136
+ logger.configure('grassland', {
137
+ host: 'localhost',
138
+ port: 24224,
139
+ timeout: 3.0
140
+ });
141
+
142
+ /*** ここまでがfluent-loggerの前準備 ***/
143
+
144
+ var param = {
145
+ dt: 'データID',
146
+ uid: '(optional)お客様のサービスのユーザID',
147
+ pt: '(optional)データの発生時刻(ISO 8601準拠の文字列 Ex. "2014-04-01T12:00:00+09:00")',
148
+ d: {
149
+ '任意のキー1': {'任意のキー2': '(int)集計を行いたいデータ'},
150
+ '(optional)任意のキー1': {'任意のキー2': '(int)集計を行いたいデータ'}
151
+ }
152
+ };
153
+ logger.emit('data', param);
113
154
  ```
@@ -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.5'
7
+ spec.version = '0.0.6'
8
8
  spec.authors = ['Ripplation Inc.']
9
9
  # spec.email = ['xxxxxx@ripplation.co.jp']
10
10
  spec.description = 'Output filter plugin for Grassland'
@@ -59,7 +59,7 @@ module Fluent
59
59
  begin
60
60
  setCredential
61
61
  configure_aws
62
- AWS.kinesis.client.put_record({
62
+ @kinesis.client.put_record({
63
63
  :stream_name => @stream_name,
64
64
  :data => "test",
65
65
  :partition_key => "#{random.rand(999)}"
@@ -144,7 +144,7 @@ module Fluent
144
144
  bufList[":#{data['pk']}"] += "#{data.to_json},"
145
145
  end
146
146
  if bufList[":#{data['pk']}"].bytesize >= 30720 then
147
- AWS.kinesis.client.put_record({
147
+ @kinesis.client.put_record({
148
148
  :stream_name => @stream_name,
149
149
  :data => "["+bufList[":#{data['pk']}"].chop+"]",
150
150
  :partition_key => partitionKeys[random.rand(partitionKeys.length)]
@@ -155,7 +155,7 @@ module Fluent
155
155
  end
156
156
  dataList.each do |data|
157
157
  if bufList[":#{data['pk']}"] != nil then
158
- AWS.kinesis.client.put_record({
158
+ @kinesis.client.put_record({
159
159
  :stream_name => @stream_name,
160
160
  :data => "["+bufList[":#{data['pk']}"].chop+"]",
161
161
  :partition_key => partitionKeys[random.rand(partitionKeys.length)]
@@ -187,7 +187,8 @@ module Fluent
187
187
  )
188
188
  end
189
189
 
190
- AWS.config(options)
190
+ @kinesis = AWS::Kinesis.new(options)
191
+ # AWS.config(options)
191
192
  end
192
193
  end
193
194
  end
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.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ripplation Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-06 00:00:00.000000000 Z
11
+ date: 2015-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd