Closed graememeyer closed 9 months ago
It's a semicolon - as intended. The README doesn't say that the CSV uses comma as a separator.
You could add an option that allows a user to define a separator of his choice.
@Neo23x0 I've been playing around with the code a bit - is it intended functionality to end all lines with the delimiter? (I'm not aware that that's common CSV definition either).
Currently the header line for example comes out:
Lookup Hash;Rating;Comment;Positives;Virus;File Names;First Submitted;Last Submitted;File Type;MD5;SHA1;SHA256;Imphash;Matching Rule;Harmless;Revoked;Expired;Trusted;Signed;Signer;Hybrid Analysis Sample;MalShare Sample;VirusBay Sample;MISP;MISP Events;URLhaus;AnyRun;CAPE;VALHALLA;User Comments;Microsoft;Kaspersky;McAfee;CrowdStrike;TrendMicro;ESET-NOD32;Symantec;F-Secure;Sophos;GData;
Edit: I ask because I would "fix" this in a PR that adds CSV functionality (where the C=comma), but if it's intended functionality, that would potentially break some existing parsers.
I'm also considering adding an option for quoted CSVs (Excel compatible with character escaping) - is this something you're interested in?
Edit 2: What I'm thinking is:
@graememeyer @Neo23x0 Due to the delimiter being a semicolon the CSV is not valid, because some of the column values contain semicola themselves, thus giving pretending to be more columns than there should be.
I fixed this in PR #66. Since PR #59 is also tackling this problem, I did not quote the column.
Further, in my assumption the trailing delimiters arise due the fact that each element is added with a dedicated write to the file. Since then you don't know which one is the last element added you have to add the ;
to avoid any issues.
I handled this by adding each column as a string that is appended to a list containing the content of one line. Instead of writing each element by itself, in the end the list is joined with the delimiter and then written to the file.
It appears the latest version of munin is writing output files delimited by semicolon characters (
;
) rather than commas (,
), even when the-o
option is applied.Example:
Output:
I feel like this issue is too obvious to have gone unnoticed, so perhaps it's intentional? If so, the documentation should be updated to reflect this, and ideally an actual CSV option added. I am happy to contribute this if you can confirm my findings and the intentionality of the issue.