From 670b533e08e43b85e600ed4e065eee4bfdf7806c Mon Sep 17 00:00:00 2001 From: Kim Sung-Jun Date: Wed, 11 Sep 2019 10:29:32 +0900 Subject: [PATCH] Collection name can be used dynamically when using mongo tail Signed-off-by: Kim Sung-Jun --- lib/fluent/plugin/in_mongo_tail.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/fluent/plugin/in_mongo_tail.rb b/lib/fluent/plugin/in_mongo_tail.rb index 89b58bc..7e3aa6c 100644 --- a/lib/fluent/plugin/in_mongo_tail.rb +++ b/lib/fluent/plugin/in_mongo_tail.rb @@ -69,6 +69,8 @@ def configure(conf) raise Fluent::ConfigError, "One of 'database' or 'url' must be specified" end + date = Time.now + @collection = date.strftime(collection) @last_id = @id_store_file ? get_last_id : nil @connection_options[:ssl] = @ssl