I am running a Node.js application deployed to Google App Engine. I am using the winston library in addition with 'Stackdriver Logging Winston plugin' [@google-cloud/logging-winston].
[Link to the tutorial for setting up winston logging]
[Link to the tutorial for exporting logs into Google Storage Bucket]
I am exporting the stackdriver logs to the Google Storage Bucket by creating a sink. Currently all the logs are getting stored in the storage bucket as 'json' files. I would like to get them stored as 'csv' files.
I am currently trying to modify the format in which winston logs are generated to get them converted to csv format, but unable to do so.
I've also looked into Stackdriver Logging Winston plugin[@google-cloud/logging-winston], but no luck here also.
Also, while exporting the logs from stackdriver logging to Storage Bucket there is no specification of the format in which the logs are to be saved. [Creating sink in Storage bucket for exporting logs]
What should the approach to get these logs stored as csv files ?
You can file a feature request for this in our UserVoice community: https://googlecloudplatform.uservoice.com/forums/302820-stackdriver
Otherwise, you could either write to GCS and then batch process the files to convert to CSV or export the logs to PubSub and process with cloud functions or Dataflow to write to a GCS bucket.