Привет, я использую эластичный поиск 7.6.1 для своего проекта, я хочу создать шаблон индекса эластичного поиска с http-index_template, но когда я пытаюсь отобразить индекс PUT следующим образом:
curl -XPUT - H 'Тип контента: приложение / json' http://my-ip: 9200 / _template / http-index_template? Pretty -d @ http-index_template. json
он говорит:
{
"error" : {
"root_cause" : [
{
"type" : "parse_exception",
"reason" : "unknown key [http-index_template] in the template "
}
],
"type" : "parse_exception",
"reason" : "unknown key [http-index_template] in the template "
},
"status" : 400
}
когда я пытаюсь изменить my-ip на localhost он говорит:
curl: (7 ) Не удалось подключиться к локальному порту 9200: отказано в подключении
, в чем здесь проблема и как это исправить?
http-index_template. json:
{
"http-index_template": {
"order": 0,
"template": "http-index*",
"settings": {},
"mappings": {
"http-log": {
"properties": {
"referer": {
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"request": {
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"virtual": {
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"method": {
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"version": {
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"response_size": {
"type": "integer"
},
"client_port": {
"type": "integer"
},
"path": {
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"hostname": {
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"@timestamp": {
"type": "date"
},
"syslog_hostname": {
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"port": {
"type": "integer"
},
"syslog_timestamp": {
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"@version": {
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"host": {
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"server_ip": {
"type": "ip"
},
"client_ip": {
"type": "ip"
},
"response_time": {
"type": "integer"
},
"server_port": {
"type": "integer"
},
"status": {
"type": "integer"
},
"User-Agent": {
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
}
}
}
},
"aliases": {}
}
}