logstash:拒绝映射更新

时间:2018-04-02 14:35:01

标签: elasticsearch logstash

我使用的模板索引包含以下条目:

"index_patterns": "myindexpattern-*",

还有...

  "mappings": {
    "_doc": {
      "dynamic" : "strict",
      "properties": {...

并将一些数据输出到ES,如下所示:

  elasticsearch {
    hosts => ["my-es-host"]
    index => "myindexpattern-%{+YYYY.MM.dd}"
    template => "/usr/share/logstash/files/my_template.json"
    template_name => "my-template"
    manage_template => true
    template_overwrite => true
  }

我收到以下错误:

logstash_1 | [2018-04-02T14:21:09,373][WARN ][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"myindexpattern-500-2015.06.20", :_type=>"doc", :_routing=>nil}, #<LogStash::Event:0x320a0860>], :response=>{"index"=>{"_index"=>"myindexpattern-500-2015.06.20", "_type"=>"doc", "_id"=>"IP67hmIBYgQuLfB3mDzK", "status"=>400, "error"=>{"type"=>"illegal_argument_exception", "reason"=>"Rejecting mapping update to [some-name-500-2015.06.20] as the final mapping would have more than 1 type: [_doc, doc]"}}}}

如何查看导致问题的字段是什么?

编辑:匿名的完整映射对象:

{
  "order": 1,
  "index_patterns": "myindexpattern-*",
  "settings": {
    "index": {
      "refresh_interval": "20s",
      "number_of_shards": "3",
      "number_of_replicas": "0",
      "codec": "best_compression"
    }
  },
  "mappings": {
    "_doc": {
      "dynamic" : "strict",
      "properties": {
        "sender": {"type": "ip"},
        "http_resp_header_contenttype": {"type":"keyword"},
        "username": {"type":"keyword"},
        "somefieldhere": {"type":"keyword"},
        "somefielthere": {"type":"keyword"},
        "anotherfield": {"type":"keyword"},
        "http_response": {"type":"keyword"},
        "src": {"type": "ip"},
        "dst": {"type":"ip"},
        "src_port": {"type": "integer", "index":false},
        "dst_port": {"type": "integer"},
        "local_time": {"type":"date"},
        "unix_time": {"type":"date"}
      }
    }
  }
}

0 个答案:

没有答案