New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CSV Agent serialize doesn't output proper CSV file, please provide example #3350
Comments
I don't think the CSV Agent works the way you want it to. When using the serialise function it takes in multiple events and combines them into a single CSV format. It doesn't remap objects from a single JSON to a single CSV and it doesn't actually create files. Example: With default CSV Agent options +
I you then send that event to the Local File Agent it will write it to disk as:
|
I wanted to send it to an FTP Agent, not Local File Agent. However the FTP Agent writes a nonsense CSV File. Does that mean the CSV Agent absolutely needs the local file Agent to translate the serialized string into an actual CSV compliant File? FTP Agent can't do it aparently. Also, I can't send separate events to the CSV Agent because I want to read data from a Key Value Store Agent and then send it as one event containing all the data. Essentially what I want is: Several Agents send Events to the Key Value Store Agent. At certain intervals the collected Data is written into a CSV File and published to an FTP. As a workaround I currently just publish a JSON File, which works with the current agent setup. |
The CSV agent just creates an event with a json name value pair, which contains just a string of characters in it. It doesn't matter whether you send it to the Local File Agent or the Ftpsite Agent (or any other agent), and just writes the data to file. There is no further "translation" happening. Previous example (escaped JSON event): When writing the content of "data" that would be: Which is the same as
Which is a valid CSV file. |
When using the CSV Agent the output is never a correctly formated CSV file.
Maybe I'm misunderstanding the CSV Agent but what's the point of it if I can't generate a properly formated CSV File with it?
No matter what I feed the CSV agent, be it JSON or Object, the output is unusable and incorrect CSV. I tried sending events from either Event Formatter Agent and Json Parse Agent to it.
Sample Data Input:
From Json Parse Agent:
OR
From Event Formatting Agent:
Sample Output of CSV Agent:
OR
Expected Result:
A proper CSV like this (generate with https://www.convertcsv.com/json-to-csv.htm):
The text was updated successfully, but these errors were encountered: