Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Updated README to fix up Configuration section, and fixed up the example #20

Merged
merged 1 commit into from
Oct 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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