I have tried the custom template, but the field defined was not added. here is what i have done:
- define the template jason file as following:
# cat graylog-custom-mapping.json
{
"template" : "graylog_*",
"message":{
"mappings" : {
"properties" : {
"xlength" : {
"type" : "integer",
"index" : "not_analyzed"
}
}
}
}
}
}
- load the template to system:
# curl -XPUT -u graylog -d @'graylog-custom-mapping.json' 'https://es1.mylogs.com:9200/_template/graylog-custom-mapping?pretty'
Enter host password for user 'graylog':
{
"acknowledged" : true
}
- check out the new template, and i found the field ‘xlength’ did not add:
# curl -XGET -u graylog 'https://es1.mylogs.com:9200/_template/graylog-custom-mapping?pretty'
Enter host password for user 'graylog':
{
"graylog-custom-mapping" : {
"order" : 0,
"template" : "graylog_*",
"settings" : { },
"mappings" : { },
"aliases" : { }
}
}
I am using elasticsearch-5.6.7-1 on centos 7.4.