You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our input plugins can provide two types of data for decoding:
line/document based data where each data chunk provided by the plugin to the codec is a complete data line or complete document. For example the file input or the http input.
stream based data where each data chunk provided by the plugin can be a part of a line/document where the complete line/document can spawn multiple chunks. For example the stdin input or the tcp input.
The way we have been dealing with this situation has beed to have two versions of a same codec, for example: json and json_lines or plain and line. Furthermore, to help deal with this confusion, we introduced the fix_streaming_codecs method to automagically swap these codecs depending on the input used.
As seen in logstash-plugins/logstash-codec-csv#8 and logstash-plugins/logstash-codec-multiline#63 some codecs would benefit from supporting two modes of operation for the 2 types of data that our input plugins can provide to codecs.
Our input plugins can provide two types of data for decoding:
fileinput or thehttpinput.stdininput or thetcpinput.The way we have been dealing with this situation has beed to have two versions of a same codec, for example:
jsonandjson_linesorplainandline. Furthermore, to help deal with this confusion, we introduced thefix_streaming_codecsmethod to automagically swap these codecs depending on the input used.logstash/logstash-core/lib/logstash/inputs/base.rb
Lines 145 to 159 in 196ec20
Until we figure a whole new/better input/codec architecture my proposal to iteratively improve the current design with:
input_typeconfig option in codecs that can support both input types (similar to [WIP] support line delimited data logstash-plugins/logstash-codec-csv#8)I am looking for comments/suggestions about this plan and if we agree on the idea I will detail the steps for each iterations.