Logging To MongoDB and specifying data types
I'm using the syslog-ng windows client to forward IIS logs to syslog-ng. I'm using the CSV parser to split it into pairs and pick and choose my pairs. I'm not able to figure out how to insert a field from these pairs (or any others) into MongoDB as a date time field. They are being stored as strings. Also I'd like to store quite a few of the other columns/elements as integers. Obviously I could run a job to do conversions after they are inserted into the database I'd just hate to setup a rube golberg machine if I don't have to. -- Michael Dillon
Michael Dillon <mdillon@reachmail.com> writes:
I'm using the syslog-ng windows client to forward IIS logs to syslog-ng. I'm using the CSV parser to split it into pairs and pick and choose my pairs. I'm not able to figure out how to insert a field from these pairs (or any others) into MongoDB as a date time field. They are being stored as strings.
Unfortunately, that is a limitation of the MongoDB destination driver, and currently, there is no way to store anything but strings. I have a few ideas - and even half-baked solutions - to make it support other types, but the code is terribly ugly at the moment, and not ready for general use yet. I hope I'll be able to enhance the mongodb destination to support at least the most useful types before 3.4 becomes stable (for 3.3, this won't happen), help is of course appreciated - even in the form of "I'd love this feature too!"s :) -- |8]
participants (2)
-
Gergely Nagy
-
Michael Dillon