I've asked a question a while back, but cant seem to find a proper solution or a work around...
I currently have a filter that parse a certain amount of logs and aggregate it all together to finalize a final log (each A, B, C, etc part logs have an identified called orderId) and we query for orderId as a keyword to aggregate proper ones (otherwise, the query would return incorrect results).
I have a custom template here:
{
"order" : 1,
"template": "logstash-transaction-*",
"settings": {
"index.refresh_interval": "5s"
},
"mappings": {
"logs": {
"_all": {
"enabled": true,
"omit_norms": true
},
"dynamic_templates": [
{
"message_field": {
"match": "message",
"match_mapping_type": "string",
"mapping": {
"type": "string",
"index": "analyzed",
"omit_norms": true
}
}
},
{
"string_fields": {
"match": "*",
"match_mapping_type": "string",
"mapping": {
"type": "string",
"index": "not_analyzed",
"ignore_above": 256
}
}
}
],
"properties": {
"orderId": {
"type": "keyword"
}
}
}
}
}
However, for some reason, once our index would be created after delete and clean restart, it would not correctly map the template... I suspect its due to this template for some reason that exist that I've asked about a long time ago here (Forcing only a particular template on index?). To summarize, I suspected that the index was affected by the other template that presumably was generated by logstash because when I do GET _template
I see there are two different templates that could be applied to my index of logstash-transaction-%{+YYYY.MM.dd}
I thought this (Disable logstash default template creation) would solve it, but it stops the logstash-*
template from generating, but my custom template is still not applied...
This is my output-elasticsearch.conf, could anyone care to expand on this behavior? Am I missing something here??
output {
if (![log]) {
elasticsearch {
hosts => [ "${OUTPUT_ELASTICSEARCH_HOSTS}" ]
index => "${OUTPUT_ELASTICSEARCH_INDEX}"
action => "${OUTPUT_ELASTICSEARCH_ACTION:index}"
document_id => "%{logGUID}"
document_type => "${OUTPUT_ELASTICSEARCH_DOCUMENT_TYPE}"
retry_on_conflict => 50
template_name => "logstash-transaction"
manage_template => true
template_overwrite => true
template => "${CONFIG_DIR}/_/logs-elasticsearch-template.json"
}
}
}