Dealing with multiple number of values from the same input - Logstash

I would do something like this.

If all types of rows have the same fields (and FLAG2/FLAG3 rows are missing some) then you can use a single csv filter with the ignore_empty_columns set to true.