Hi David,
Thank you for the prompt answer.
Actually I did all the described actions via curl commands.
I try to import an index template via (with no pmdata* indices in elasticsearch):
curl -k -XPUT --header 'Authorization: Basic YWRtaW46cUUzRSZGRSMyUXNsUzkmcQ==' "https://10.254.88.15:9200/_template/template_1?pretty" -H 'Content-Type: application/json' -d @pmdata_map_float_to_template_v2.json
where the content of pmdata_map_float_to_template_v2.json
is the below :
{
"index_patterns" : "pmdata*",
"template" : {
"settings": {
"index.refresh_interval": "5s"
},
"mappings": {
"_default_": {
"properties": {
"counter_display_name": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"counter_group_name": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"counter_name": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"counter_value": {
"type": "float"
},
"date": {
"type": "date"
},
"distinguished_name": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"is_dynamic": {
"type": "boolean"
},
"measurement_time": {
"type": "date"
},
"vnf_name": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"vnf_type": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
}
}
}
}
After that I get
{
"acknowledged" : true
}
Then I import a pmdata index which has as counter_value the number 7 for example.
Then I am checking the mapping of the index with
curl -k -XGET --header 'Authorization: Basic YWRtaW46cUUzRSZGRSMyUXNsUzkmcQ==' "https://10.254.88.15:9200/pmdata*/_mapping?pretty"
and I am getting the below :
{
"pmdata-zts6-2021-03-05" : {
"mappings" : {
"properties" : {
"counter_display_name" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"counter_group_name" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"counter_name" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"counter_value" : {
"type" : "long"
},
"date" : {
"type" : "date"
},
"distinguished_name" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"is_dynamic" : {
"type" : "boolean"
},
"measurement_time" : {
"type" : "date"
},
"vnf_name" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"vnf_type" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
}
}
}
}
I was expecting that since the imported template was with type float for counter_value
, that even it was imported an integer (here 7) , still in mapping the type of the counter_value
would be float.
Sorry for the long text.
Thank you again!