An open API service indexing awesome lists of open source software.

https://github.com/fluent-plugins-nursery/fluent-plugin-parser-protobuf

Fluentd parser plugin for [Protocol Buffers](https://developers.google.com/protocol-buffers/docs/overview).
https://github.com/fluent-plugins-nursery/fluent-plugin-parser-protobuf

fluentd fluentd-parser-plugin fluentd-plugin protobuf2 protobuf3

Last synced: 10 months ago
JSON representation

Fluentd parser plugin for [Protocol Buffers](https://developers.google.com/protocol-buffers/docs/overview).

Awesome Lists containing this project

README

          

# fluent-plugin-parser-protobuf

![Testing on Windows](https://github.com/fluent-plugins-nursery/fluent-plugin-parser-protobuf/workflows/Testing%20on%20Windows/badge.svg?branch=master)
![Testing on macOS](https://github.com/fluent-plugins-nursery/fluent-plugin-parser-protobuf/workflows/Testing%20on%20macOS/badge.svg?branch=master)
![Testing on Ubuntu](https://github.com/fluent-plugins-nursery/fluent-plugin-parser-protobuf/workflows/Testing%20on%20Ubuntu/badge.svg?branch=master)

Fluentd parser plugin for [Protocol Buffers](https://developers.google.com/protocol-buffers/docs/overview).

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'fluent-plugin-parser-protobuf'
```

And then execute:

$ bundle install

Or install it yourself as:

$ gem install fluent-plugin-parser-protobuf

## Prerequisites to use

Users should prepare protocol buffers with the following compilers:

* For Protocol Buffers 2, using [ruby-protoc compiler](https://github.com/codekitchen/ruby-protocol-buffers) is needed.
* For Protocol Buffers 3, using [the official protoc compiler](https://developers.google.com/protocol-buffers/docs/reference/ruby-generated) is needed.

## Configuration

**Note:** Protocol Buffer v2 files use `.pb.rb` extensions whereas Protocol Buffer v3 files use `_pb.rb` in their filename endings. Please be careful which version is used in your protobuf definitions.

### For Protobuf 3

```aconf

@type protobuf
class_file /path/to/your/protobuf/class_file_pb.rb
class_name Your.Protobuf.Class.Name # For protobuf3
protobuf_version protobuf3
# suppress_decoding_error false
# include_paths [/path/to/your/protobuf/class_file_pb.rb, /path/to/your/protobuf/class_file2_pb.rb, ...]

```

**Note:** Protobuf version 3 requires to use dot for nested class name seperator:

`Your::Protobuf::Class::Name` class should be in class_name as follows:
```
class_name Your.Protobuf.Class.Name
```

### For Protobuf 2

```aconf

@type protobuf
class_file /path/to/your/protobuf/class_file.pb.rb
class_name Your::Protobuf::Class::Name # For protobuf2
protobuf_version protobuf2
# suppress_decoding_error false
# include_paths [/path/to/your/protobuf/class_file.pb.rb, /path/to/your/protobuf/class_file2.pb.rb, ...]

```

## Development

After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/fluent-plugins-nursery/fluent-plugin-parser-protobuf.

## Articles

* FluentdのInputプラグインでProtocol Buffersを扱う -- ククログ https://www.clear-code.com/blog/2020/6/4.html (ja)

## LICENSE

[Apache-2.0](LICENSE).