Skip to content

Commit

Permalink
Merge pull request #20 from fluent-plugins-nursery/docs/update-readme
Browse files Browse the repository at this point in the history
docs: Updated `README` to fix up Configuration section, and fixed up the example
  • Loading branch information
raytung authored Oct 30, 2021
2 parents 19ee264 + 39a06b1 commit 866329b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,18 @@ $ bundle
<format>
@type protobuf
message_name "Log"
class_name "Log"
include_paths ["/opt/fluent-plugin-formatter-protobuf/log_pb.rb"]
</format>
</match>
```

## Configuration

You can generate configuration template:

```
$ fluent-plugin-config-format formatter formatter-protobuf
```

You can copy and paste generated documents here.
|parameter|type|description|default|
|---|---|---|---|
|include_paths|array (optional)| Generated Ruby Protobuf class files path |`[]`|
|class_name|string (required)| Ruby Protobuf class name. Used to encode into Protobuf binary||

## Copyright

Expand Down
6 changes: 2 additions & 4 deletions lib/fluent/plugin/formatter_protobuf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@ module Plugin
class ProtobufFormatter < Fluent::Plugin::Formatter
Fluent::Plugin.register_formatter('protobuf', self)

# Absolute paths to the generated Ruby protobuf files
config_param :include_paths, :array, default: []
config_param :include_paths, :array, default: [], desc: 'Generated Ruby Protobuf class files path'

# Protobuf message name
config_param :class_name, :string
config_param :class_name, :string, desc: 'Ruby Protobuf class name. Used to encode into Protobuf binary'

def configure(conf)
super(conf)
Expand Down

0 comments on commit 866329b

Please sign in to comment.