Add [ ] to codec => json

Hi,
can i add [ ] to json file ? because

output{
file { 
codec => json
path => ["D:/elastic_stack/test/temp.json"]
}
}

it gives me { 'a':'a','b':'b'}{'c':'c'} i want to add [ ] so i wanted like this [{ 'a' : 'a','b':'b'}{'c':'c'}]

Any help would be sincerely appreciate!
Thanks!

or maybe create a file with [] and insert docs in those brackets or something...hope it's possible because I couldn't find something like that in the documentation

Thanks!

It seems very simple and logical, but I can't find the solution for it ... :confused:

What you are asking for is not valid JSON. A json codec will produce valid JSON, so it cannot produce what you are asking for.

OK thank you I would like to ask you if I can edit the file with logstash then?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.