Hi all,
I have a logstash config, which creates the new index every day. They are mapped dynamically. The problem with dynamic mapping is, one of my field named value, gets mapped to double and some time it gets mapped to long. How can i restrict my self, for upcoming indexes to for that particular fileld mapped only to double.
logstash config
input.conf
input {
kafka {
zk_connect => 'ip:2181'
topic_id => 'collectdmetrics'
consumer_threads => 3
group_id => "collectd"
}
}
output {
if [type] == 'collectd' {
elasticsearch {
hosts => ["ip:9200"]
manage_template => false
index => "collectdmetrics-%{+YYYY.MM.dd}"
}
}
curl -XGET http://localhost:9200/collectdmetrics-2016.05.29/_mapping
{
"collectdmetrics-2016.05.29": {
"mappings": {
"collectd": {
"properties": {
"@timestamp": {
"type": "date",
"format": "strict_date_optional_time||epoch_millis"
},
"@version": {
"type": "string"
},
"MemoryUsed": {
"type": "double"
},
"Thoughput": {
"type": "double"
},
"host": {
"type": "string"
},
"hostname": {
"type": "string"
},
"message": {
"type": "string"
},
"plugin": {
"type": "string"
},
"port": {
"type": "long"
},
"type": {
"type": "string"
},
"type_instance": {
"type": "string"
},
"value": {
"type": "double"
},
"value1": {
"type": "double"
}
}
}
}
}
}