We load logs from apache access log file with fluent in_tail plugin and load into mongodb with the out_mongo plugin. We have about 10 different kinds of log messages in the log file. Would ideally like to keep them in separate mongo collections so the TTL (or capped collection size) can be set separately for each one of them. Just want to know which of these two approaches is better:
Keep separate
<source>
mappings in the fluent config file, all of which tail the same log file, but use differentformat
regexes. Then I canmatch
each one of these to a different mongo collection. (I believe it is not possible to specify multipleformat
regexes for multiple tags within one<source>
element?)Store all the logs in a single "raw" mongo collection and then write my own code to extract the different types of logs for the different types. I believe this option is best for performance, but not sure if the first approach is really bad.