How to transfer the array to csv format

Unfortunately, I am not sure how you would do that. I had a similar issue with some data I was ingesting and had to build a PowerShell script to copy the required data into each event.