fluent-plugin-festival 0.0.14 → 0.0.15
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/examples/README.md +103 -3
- data/fluent-plugin-festival.gemspec +1 -1
- data/lib/fluent/plugin/festival_proxy.rb +9 -0
- 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: c878ebf9326887ea4dcf848b9eb9ff9f6a619b21
|
4
|
+
data.tar.gz: b8c229f3c651914a67d40e4a82c89f79863e0c4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abb8bdfc279725da3bdfaf526d5eca95c0ce9e620053a782f263d03ee5e64ec309b1afed0a980b308a75289b4cb5f2ba78e4eb4465c4a12f5a8418f5b5c5184d
|
7
|
+
data.tar.gz: b43deb5aae8eb38b35c20a92c0fabb4e2df9e716856dc866e8f7a1bda7765979e0e5e008e91b31d2c463eeba491a298761b7d395a62789e7febba06355af1581
|
data/examples/README.md
CHANGED
@@ -6,12 +6,49 @@
|
|
6
6
|
gem install fluent-plugin-festival
|
7
7
|
```
|
8
8
|
|
9
|
-
fluentd
|
9
|
+
fluentd will be installed automatically.
|
10
10
|
|
11
11
|
|
12
12
|
## Create a sample configuration file
|
13
13
|
|
14
|
-
Create a sample configuration file as follows.
|
14
|
+
Create a sample configuration file as follows. For sensinact api_type case, you can specify dummy username and password.
|
15
|
+
|
16
|
+
For api_type: sensinact
|
17
|
+
|
18
|
+
```
|
19
|
+
% vi fluent.conf
|
20
|
+
---
|
21
|
+
<source>
|
22
|
+
@type festival
|
23
|
+
tag test1
|
24
|
+
api_uri http://example.sensinact.uri:8080
|
25
|
+
api_type sensinact
|
26
|
+
#use_sensor_time
|
27
|
+
email dummy@example.com
|
28
|
+
password dummy_password
|
29
|
+
polling_interval 10
|
30
|
+
<resource>
|
31
|
+
path carsensor011_100Hz/services/data/resources/PM2.5/GET
|
32
|
+
fixed_location [135.0, 35.0]
|
33
|
+
</resource>
|
34
|
+
<resource>
|
35
|
+
path carsensor081_100Hz/services/data/resources/PM2.5/GET
|
36
|
+
fixed_location [135.0, 35.0]
|
37
|
+
</resource>
|
38
|
+
@label @test0
|
39
|
+
</source>
|
40
|
+
|
41
|
+
<label @test0>
|
42
|
+
<match test*>
|
43
|
+
@type stdout
|
44
|
+
</match>
|
45
|
+
</label>
|
46
|
+
---
|
47
|
+
```
|
48
|
+
|
49
|
+
For festival api_type case, You need to change festival_portal_login_name and festival_portal_password to your account information.
|
50
|
+
|
51
|
+
For api_type: festival
|
15
52
|
|
16
53
|
```
|
17
54
|
% vi fluent.conf
|
@@ -97,9 +134,72 @@ vi iot_gateway-mapping.json
|
|
97
134
|
---
|
98
135
|
|
99
136
|
curl -XPUT 'http://localhost:9200/festival'
|
100
|
-
curl -XPUT 'http://localhost:9200/festival/iot_gateway/_mapping' -d @iot_gateway-mapping.json
|
137
|
+
curl -H "Content-Type: application/json" -XPUT 'http://localhost:9200/festival/iot_gateway/_mapping' -d @iot_gateway-mapping.json
|
138
|
+
```
|
139
|
+
|
140
|
+
For api_type: sensinact
|
141
|
+
|
142
|
+
```
|
143
|
+
% vi fluent.conf
|
144
|
+
---
|
145
|
+
<source>
|
146
|
+
@type festival
|
147
|
+
tag test1
|
148
|
+
api_uri http://example.sensinact.uri:8080
|
149
|
+
api_type sensinact
|
150
|
+
#use_sensor_time
|
151
|
+
email dummy@example.com
|
152
|
+
password dummy_password
|
153
|
+
polling_interval 10
|
154
|
+
<resource>
|
155
|
+
path carsensor011_100Hz/services/data/resources/PM2.5/GET
|
156
|
+
fixed_location [135.0, 35.0]
|
157
|
+
</resource>
|
158
|
+
<resource>
|
159
|
+
path carsensor081_100Hz/services/data/resources/PM2.5/GET
|
160
|
+
fixed_location [135.0, 35.0]
|
161
|
+
</resource>
|
162
|
+
@label @test0
|
163
|
+
</source>
|
164
|
+
|
165
|
+
<label @test0>
|
166
|
+
<filter test*>
|
167
|
+
@type record_transformer
|
168
|
+
enable_ruby
|
169
|
+
auto_typecast
|
170
|
+
<record>
|
171
|
+
timestamp ${time.strftime("%FT%T.%L%:z")}
|
172
|
+
</record>
|
173
|
+
</filter>
|
174
|
+
|
175
|
+
# If you want to output the messages not only into Elasticsearch
|
176
|
+
# but also into standard output, please enable comment out lines.
|
177
|
+
<match test*>
|
178
|
+
@type copy
|
179
|
+
<store>
|
180
|
+
@type elasticsearch
|
181
|
+
host localhost
|
182
|
+
port 9200
|
183
|
+
index_name festival
|
184
|
+
type_name iot_gateway
|
185
|
+
logstash_format false
|
186
|
+
include_tag_key true
|
187
|
+
time_key timestamp
|
188
|
+
<buffer tag>
|
189
|
+
flush_thread_count 4
|
190
|
+
flush_interval 30s
|
191
|
+
</buffer>
|
192
|
+
</store>
|
193
|
+
<store>
|
194
|
+
@type stdout
|
195
|
+
</store>
|
196
|
+
</match>
|
197
|
+
</label>
|
198
|
+
---
|
101
199
|
```
|
102
200
|
|
201
|
+
For api_type: festival
|
202
|
+
|
103
203
|
```
|
104
204
|
% vi fluent.conf
|
105
205
|
---
|
@@ -33,6 +33,15 @@ module Fluent::Plugin
|
|
33
33
|
log.debug "body: #{response.body}"
|
34
34
|
return false
|
35
35
|
end
|
36
|
+
if @api_type == "sensinact"
|
37
|
+
body = JSON.parse(response.body)
|
38
|
+
if body["statusCode"] != 200
|
39
|
+
log.error error: message
|
40
|
+
log.debug "code: #{body["statusCode"]}"
|
41
|
+
log.debug "body: #{response.body}"
|
42
|
+
return false
|
43
|
+
end
|
44
|
+
end
|
36
45
|
return true
|
37
46
|
end
|
38
47
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-festival
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Toyokazu Akiyama
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|