Я использую ElasticSearch 6.2.4. Я попытался создать шаблон индекса Filebeat, но получил следующую ошибку
{
"error" : {
"root_cause" : [
{
"type" : "mapper_parsing_exception",
"reason" : "No handler for type [string] declared on field [message]"
}
],
"type" : "mapper_parsing_exception",
"reason" : "Failed to parse mapping [_default_]: No handler for type [string] declared on field [message]",
"caused_by" : {
"type" : "mapper_parsing_exception",
"reason" : "No handler for type [string] declared on field [message]"
}
},
"status" : 400
}
filebeat-index.template.json
{
"mappings": {
"_default_": {
"_all": {
"enabled": true,
"norms": {
"enabled": false
}
},
"dynamic_templates": [
{
"template1": {
"mapping": {
"doc_values": true,
"ignore_above": 1024,
"index": "not_analyzed",
"type": "{dynamic_type}"
},
"match": "*"
}
}
],
"properties": {
"@timestamp": {
"type": "date"
},
"message": {
"type": "string",
"index": "analyzed"
},
"offset": {
"type": "long",
"doc_values": "true"
},
"geoip" : {
"type" : "object",
"dynamic": true,
"properties" : {
"location" : { "type" : "geo_point" }
}
}
}
}
},
"settings": {
"index.refresh_interval": "5s"
},
"template": "filebeat-*"
}
Интересно, есть ли официальный filebeat-index-template.json , который работает для ElasticSearch 6.2.4
Другое, что я пробовал
- Попробуйте
filebeat -c "/etc/filebeat/filebeat.yml" export template > filebeat.template.json
, но файловый ритм будет работать вечно, ничего не создавая.
- Я пытался изменить
"type": "string"
на "type": "text",
, но получил еще одну ошибку, где _all
устарело.
- Я также пытался удалить
_all
, но ElasticSearch продолжает иметь ошибку синтаксического анализа, когда Logstash отправляет данные в ElasticSearch.
Filebeat Version [Старая версия]
Я также пытаюсь выяснить версию моего Filebeat. Я пытался
> filebeat -v
Loading config file error: Failed to read /root/filebeat.yml: open /root/filebeat.yml: no such file or directory. Exiting.
> filebeat -v -c "/etc/filebeat/filebeat.yml"
(it struck forever)
Я следую этому https://www.digitalocean.com/community/tutorials/how-to-install-elasticsearch-logstash-and-kibana-elk-stack-on-ubuntu-14-04,, но вместо использования ElasticSearch 2.0 и Kibana 4.5 я устанавливаю ElasticSearch 6.2.4, Kibana 6.2.4, Logstash 6.2.4 и Ubuntu 16.04.4 LTS
Обновление до Filebeat 6.2.4
Сейчас я обновляю Filebeat до 6.2.4. Теперь я получаю эту ошибку
Exiting: Could not start registrar: Error loading state: Error decoding states: json: cannot unmarshal object into Go value of type []file.State
Я удалил эту ошибку на rm /var/lib/filebeat/registry
. Теперь я могу сделать filebeat export template > template.json
, и теперь он работает нормально. Я скоро закрою вопрос.