tsaikd / gogstash

Logstash like, written in golang
MIT License
644 stars 106 forks source link

added Encode() to codecs #171

Closed helgeolav closed 3 years ago

helgeolav commented 3 years ago

I looked at the codec and added some code to Encode() for both JSON and the default to be able to produce output using encode. I also rewrote stdout to be able to prove that it works.

At this point I added Codec directly to stdout instead of config.Outputconfig for two reasons. One is that #170 is proposing a change on the same file, but also because I am just testing the codec Encode() as this point.

The reason for doing this is that some outputs can benefit from a codec. NSQ in #168 could use this to control the output format depending on what your needs are.