Logstash write to json no comma separator

Thank you very much for your reply one more time.
I have been looking into logstash documentations, and I cannot find much about this.

The only thing I could find is about this?

 file {
    codec => line {format => ","}

The file output, by default is a json file, which is perfect. and according to the documentation, we can customise the output using the format, which is great. Running that configuration, it works but it does not add the comma at the end of each event, but add one for each event at the end of the file.

But that's it, there is nothing regarding this.

You have more experience than me on this, maybe I am missing some documentation about this or how this file codec works?

Thank you so much for any clarification