Hi, I'm Quinn, I use Fluentd config file to create an index and setting the mapping, and I want the index can be auto create datetime for everyday, like test-index-2018.05.17....test-index-2018.05.18. Blow is my fluentd detail config, I can't be works, so anyone can help me find what problem?
<source>
@type tail
path /data/test/logs/test-index.log
tag test.index
pos_file /var/log/td-agent/test.index.pos
<parse>
@type ltsv
</parse>
</source>
<match test.index>
@type elasticsearch
host xxx
port xxx
user xxx
password xxx
include_tag_key true
tag_key @log_name
logstash_format true
logstash_prefix test-index
template_overwrite true
templates { "test-index-*": "/etc/td-agent/mapping.json" }
flush_interval 10s
buffer_type file
buffer_chunk_limit 8M
buffer_path /var/log/td-agent/buffer/test-index
</match>
-----------------------------------------------------------------------
mapping.json
{
"mappings" : {
"fluentd" : {
"properties" : {
"host" : {
"type" : "keyword"
},
"req" : {
"type" : "long"
},
"status" : {
"type" : "integer"
},
"timestamp" : {
"type" : "date",
"format" : "epoch_second"
}
}
}
},
"template": "test-index-*"
}