cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Can the File Writer snap output plain text?

DSander
New Contributor II

It seems that the File Writer is only capable of outputting JSON to the file, and every write is on the same line. I would like to know if it is possible to write plain text to the file with every log is on a new line.

Also, is this File Writer thread safe? If I have two pipelines both writing to the same file, would it throw an error, or would it lock the file and write when the one or the other is completed?

1 REPLY 1

aleung
Contributor III

You can achieve that by use CSV formatter with 1 field. It will write out the value of that 1 field 1 line at a time for as many occurrence you have.

As for thread safe, unless you are doing the following protocols you wonโ€™t be able to use Append anyway. Consider adding timestamp in your write file to ensure uniqueness.

Append - Append is supported for file, FTP, FTPS and SFTP protocols only.