logstash-plugins / logstash-codec-avro

A logstash codec plugin for decoding and encoding Avro records
Apache License 2.0
15 stars 63 forks source link

Add `encoding` selector option (base64 or binary) #39

Closed andsel closed 2 years ago

andsel commented 2 years ago

Release notes

Add encoding option to select the encoding of Avro payload between base64 (default) and binary

What does this PR do?

Adds encoding set option to choose the encoding of Avro payload. By default it's set to base64.

Why is it important/What is the impact to the user?

Let the user to decide whether to use binary or base64 encoding.

Checklist

Author's Checklist

How to test this PR locally

output { stdout { codec => avro { schema_uri => "/tmp/avro_schema_payment.asvc" base64_encoding => false } } }

- Avro schema to save in  `/tmp/avro_schema_payment.asvc`

{"namespace": "io.confluent.examples.clients.basicavro", "type": "record", "name": "Payment", "fields": [ {"name": "id", "type": "string"}, {"name": "amount", "type": "double"} ] }



## Related issues

<!-- Recommended
Link related issues below. Insert the issue link or reference after the word "Closes" if merging this should automatically close it.

- Closes #123
- Relates #123
- Requires #123
- Superseeds #123
-->
- Closes #30

## Use cases
As user I want to receive the binary Avro payload without base64 encoding.
andsel commented 2 years ago

I would ask if @karenzone could give a quick check to the documentation change

andsel commented 2 years ago

Published with https://rubygems.org/gems/logstash-codec-avro/versions/3.4.0-java