fluent-plugin-avro 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +29 -0
- data/fluent-plugin-avro.gemspec +1 -1
- data/lib/fluent/plugin/formatter_avro.rb +9 -2
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ba36dddb8462493270ebc6b5168e52ae47ccddb
|
4
|
+
data.tar.gz: 93a4a16e79b74b3259656df8c728c5335f09c40f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ca3f2caa9ae8409bc0a3115e081f6ac74493cff06492bd8031983c76c233e3b11334aff82f371549ce3beedf640592a1b7b2df535f5726b7dd3e5bc853ae974
|
7
|
+
data.tar.gz: de6c798bb18e897efd8c2bb77e21651ce1b47c0250cacb841530213ae8928da9deffaa90ceff31fa6adaf902604feec3ec2131251af963a5553db7c9cb6f0b3d
|
data/README.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# fluent-plugin-avro
|
2
|
+
|
3
|
+
fluent-plugin-avro provides a formatter plugin for Fluentd.
|
4
|
+
|
5
|
+
## Configurations
|
6
|
+
|
7
|
+
| Name | Description |
|
8
|
+
| ---- | ----------- |
|
9
|
+
| `schema_file` | filename of Avro schema |
|
10
|
+
| `schema_json` | JSON representation of Avro schema |
|
11
|
+
|
12
|
+
### Example
|
13
|
+
|
14
|
+
```
|
15
|
+
<match example.avro>
|
16
|
+
type file
|
17
|
+
path /path/to/output
|
18
|
+
format avro
|
19
|
+
|
20
|
+
schema_file /path/to/schema.avsc
|
21
|
+
|
22
|
+
## You can use schema_json instead of schema_file
|
23
|
+
# schema_json {"type":"record","name":"example","namespace":"org.example","fields":[{"name":"message","type":"string"}]}
|
24
|
+
</match>
|
25
|
+
```
|
26
|
+
|
27
|
+
## License
|
28
|
+
|
29
|
+
Apache License, Version 2.0.
|
data/fluent-plugin-avro.gemspec
CHANGED
@@ -5,11 +5,18 @@ module Fluent
|
|
5
5
|
class AvroFormatter < Formatter
|
6
6
|
Fluent::Plugin.register_formatter('avro', self)
|
7
7
|
|
8
|
-
config_param :schema_file, :string
|
8
|
+
config_param :schema_file, :string, :default => nil
|
9
|
+
config_param :schema_json, :string, :default => nil
|
9
10
|
|
10
11
|
def configure(conf)
|
11
12
|
super
|
12
|
-
|
13
|
+
if not (@schema_json.nil? ^ @schema_file.nil?) then
|
14
|
+
raise Fluent::ConfigError, 'schema_json or schema_file (but not both) is required'
|
15
|
+
end
|
16
|
+
if @schema_json.nil? then
|
17
|
+
@schema_json = File.read(@schema_file)
|
18
|
+
end
|
19
|
+
@schema = Avro::Schema.parse(@schema_json)
|
13
20
|
end
|
14
21
|
|
15
22
|
def format(tag, time, record)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-avro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shun Takebayashi
|
@@ -76,6 +76,7 @@ files:
|
|
76
76
|
- ".gitignore"
|
77
77
|
- Gemfile
|
78
78
|
- LICENSE.txt
|
79
|
+
- README.md
|
79
80
|
- Rakefile
|
80
81
|
- fluent-plugin-avro.gemspec
|
81
82
|
- lib/fluent/plugin/formatter_avro.rb
|