elasticsearch Elasticsearch:字段[hostname]上声明的类型[keyword]没有处理程序
当从filebeat索引日志时,我在Elasticsearch上看到上面的映射器解析错误elasticsearch Elasticsearch:字段[hostname]上声明的类型[keyword]没有处理程序,elasticsearch,logstash,elastic-stack,filebeat,elasticsearch,Logstash,Elastic Stack,Filebeat,当从filebeat索引日志时,我在Elasticsearch上看到上面的映射器解析错误 { "mappings": { "_default_": { "_all": { "norms": false }, "dynamic_templates": [ { "fields": { "mapping": { "ignore_above": 1024
{
"mappings": {
"_default_": {
"_all": {
"norms": false
},
"dynamic_templates": [
{
"fields": {
"mapping": {
"ignore_above": 1024,
"type": "keyword"
},
"match_mapping_type": "string",
"path_match": "fields.*"
}
}
],
"properties": {
"@timestamp": {
"type": "date"
},
"beat": {
"properties": {
"hostname": {
"ignore_above": 1024,
"type": "keyword"
},
"name": {
"ignore_above": 1024,
"type": "keyword"
}
}
},
"input_type": {
"ignore_above": 1024,
"type": "keyword"
},
"message": {
"norms": false,
"type": "text"
},
"offset": {
"type": "long"
},
"source": {
"ignore_above": 1024,
"type": "keyword"
},
"type": {
"ignore_above": 1024,
"type": "keyword"
}
}
}
},
"order": 0,
"settings": {
"index.refresh_interval": "5s"
},
"template": "filebeat-*"
}
我尝试了Filebeat->Elasticserach和Filebeat->Logstash->Elasticsearch方法
我遵循了他们自己的文档,我按照指示安装了filebeat模板,并从
我的elasticsearch与我的其他数据索引正常工作,我在Kibana上测试了它们。这是docker的官方安装
谷歌搜索了很多,但没有任何运气,因此,任何帮助都是非常感谢的
更新1:
ES版本:2.3.3(我相信是最新版本)
模板文件是filebeat附带的默认文件
{
"mappings": {
"_default_": {
"_all": {
"norms": false
},
"dynamic_templates": [
{
"fields": {
"mapping": {
"ignore_above": 1024,
"type": "keyword"
},
"match_mapping_type": "string",
"path_match": "fields.*"
}
}
],
"properties": {
"@timestamp": {
"type": "date"
},
"beat": {
"properties": {
"hostname": {
"ignore_above": 1024,
"type": "keyword"
},
"name": {
"ignore_above": 1024,
"type": "keyword"
}
}
},
"input_type": {
"ignore_above": 1024,
"type": "keyword"
},
"message": {
"norms": false,
"type": "text"
},
"offset": {
"type": "long"
},
"source": {
"ignore_above": 1024,
"type": "keyword"
},
"type": {
"ignore_above": 1024,
"type": "keyword"
}
}
}
},
"order": 0,
"settings": {
"index.refresh_interval": "5s"
},
"template": "filebeat-*"
}
更新2:
你说得对,明白吗
#/usr/share/filebeat/bin/filebeat--version
filebeat版本5.0.0-alpha2(amd64),libbeat版本5.0.0-alpha2
尽管这是将apache日志发布到logstash。但我无法以正确的格式获取此vhost_组合日志
sub1.example.com:4431.9.202.41---[03/Jun/2016:06:58:17+0000]“GET/notifications/pendingCount HTTP/1.1”200 591 0 32165https://sub1.example.com/path/index?var=871190“Mozilla/5.0(Windows NT 6.1;WOW64)AppleWebKit/537.36(KHTML,像Gecko)Chrome/50.0.2661.102 Safari/537.36”
“message”=>“%{HOSTNAME:vhost}\:%{NUMBER:port}%{COMBINEDAPACHELOG}”
您不能在ES 2.3.3中使用“type”:“keyword”
,因为这是ES 5中的一种新数据类型(目前为alpha3)
您需要将所有这些事件替换为
"type": "string",
"index": "not_analyzed"
您需要改为使用。
关键字
在ES 5中是一个新的关键字,但在ES 2中尚不受支持。你有哪个版本的ES?你的filebeat模板是什么样子的?为你添加了模板和版本信息@ValI已经从您上次的评论中了解到了这一点,现在ES上的情况很好。Filebeat官方文件应提及这一非常关键的信息,因为ES 2.3.3仍然是doc的官方版本。您拥有哪个版本的Filebeat,以及如何安装它?我有最新的一个,即与ES 2.3.3完美配合,即没有“类型”:“关键字”
。我从他们的官方文档安装了filebeat。他们在/etc/filebeat/目录中提供了上述es2模板以及filebeat.template.json。我只是删除了旧模板,并把新模板。此版本没有type关键字。能否确认您已安装Filebeat 1.2而不是Filebeat 5.0?根据您使用的版本,他们的文档有不同的版本。现在的官方软件包是,有一个没有“关键字”的单一模板文件。请随意发布另一个问题与这个新的具体问题。