【问题标题】:ERROR:[mapper_parsing_exception] Root mapping definition has unsupported parameters: "Elasticserach"错误:[mapper_parsing_exception] 根映射定义具有不受支持的参数:“Elasticsearch”
【发布时间】:2020-07-24 16:35:20
【问题描述】:

我正在尝试将 SendGrid 事件发送到 kibana,但出现以下错误

[root@elasticsearch-7 /]# sendgrid-event-logger

Installing template..
ERROR:[mapper_parsing_exception] Root mapping definition has unsupported parameters:  [log : {dynamic_templates=[{string_fields={mapping={fielddata={format=disabled}, index=analyzed, omit_norms=true, type=string, fields={raw={index=not_analyzed, type=string}}}, match_mapping_type=string, match=*}}], properties={date={format=yyyy.MM.dd, type=date}, sg_message_id={index=not_analyzed, type=string}, ip={index=not_analyzed, type=ip}, sg_event_id={index=not_analyzed, type=string}, event={index=not_analyzed, type=string}, email={fielddata={format=disabled}, index=analyzed, omit_norms=true, type=string, fields={domain={analyzer=email_domain_analyzer, index=analyzed, type=string}, raw={index=not_analyzed, type=string}}}, timestamp={format=epoch_second, type=date}}}] :: {"path":"/_template/sendgrid_template","query":{},"body":"{\"template\":\"mail-*\",\"settings\":{\"number_of_shards\":1,\"index\":{\"analysis\":{\"tokenizer\":{\"email_domain_tokenizer\":{\"type\":\"pattern\",\"pattern\":\"^.+@\",\"group\":-1}},\"analyzer\":{\"email_domain_analyzer\":{\"type\":\"custom\",\"tokenizer\":\"email_domain_tokenizer\"}}}}},\"mappings\":{\"log\":{\"dynamic_templates\":[{\"string_fields\":{\"match\":\"*\",\"match_mapping_type\":\"string\",\"mapping\":{\"type\":\"string\",\"index\":\"analyzed\",\"omit_norms\":true,\"fielddata\":{\"format\":\"disabled\"},\"fields\":{\"raw\":{\"type\":\"string\",\"index\":\"not_analyzed\"}}}}}],\"properties\":{\"email\":{\"type\":\"string\",\"index\":\"analyzed\",\"omit_norms\":true,\"fielddata\":{\"format\":\"disabled\"},\"fields\":{\"raw\":{\"type\":\"string\",\"index\":\"not_analyzed\"},\"domain\":{\"type\":\"string\",\"index\":\"analyzed\",\"analyzer\":\"email_domain_analyzer\"}}},\"timestamp\":{\"type\":\"date\",\"format\":\"epoch_second\"},\"date\":{\"type\":\"date\",\"format\":\"yyyy.MM.dd\"},\"event\":{\"type\":\"string\",\"index\":\"not_analyzed\"},\"ip\":{\"type\":\"ip\",\"index\":\"not_analyzed\"},\"sg_event_id\":{\"type\":\"string\",\"index\":\"not_analyzed\"},\"sg_message_id\":{\"type\":\"string\",\"index\":\"not_analyzed\"}}}},\"aliases\":{\"mail\":{}}}","statusCode":400,"response":"{\"error\":{\"root_cause\":[{\"type\":\"mapper_parsing_exception\",\"reason\":\"Root mapping definition has unsupported parameters:  [log : {dynamic_templates=[{string_fields={mapping={fielddata={format=disabled}, index=analyzed, omit_norms=true, type=string, fields={raw={index=not_analyzed, type=string}}}, match_mapping_type=string, match=*}}], properties={date={format=yyyy.MM.dd, type=date}, sg_message_id={index=not_analyzed, type=string}, ip={index=not_analyzed, type=ip}, sg_event_id={index=not_analyzed, type=string}, event={index=not_analyzed, type=string}, email={fielddata={format=disabled}, index=analyzed, omit_norms=true, type=string, fields={domain={analyzer=email_domain_analyzer, index=analyzed, type=string}, raw={index=not_analyzed, type=string}}}, timestamp={format=epoch_second, type=date}}}]\"}],\"type\":\"mapper_parsing_exception\",\"reason\":\"Failed to parse mapping [_doc]: Root mapping definition has unsupported parameters:  [log : {dynamic_templates=[{string_fields={mapping={fielddata={format=disabled}, index=analyzed, omit_norms=true, type=string, fields={raw={index=not_analyzed, type=string}}}, match_mapping_type=string, match=*}}], properties={date={format=yyyy.MM.dd, type=date}, sg_message_id={index=not_analyzed, type=string}, ip={index=not_analyzed, type=ip}, sg_event_id={index=not_analyzed, type=string}, event={index=not_analyzed, type=string}, email={fielddata={format=disabled}, index=analyzed, omit_norms=true, type=string, fields={domain={analyzer=email_domain_analyzer, index=analyzed, type=string}, raw={index=not_analyzed, type=string}}}, timestamp={format=epoch_second, type=date}}}]\",\"caused_by\":{\"type\":\"mapper_parsing_exception\",\"reason\":\"Root mapping definition has unsupported parameters:  [log : {dynamic_templates=[{string_fields={mapping={fielddata={format=disabled}, index=analyzed, omit_norms=true, type=string, fields={raw={index=not_analyzed, type=string}}}, match_mapping_type=string, match=*}}], properties={date={format=yyyy.MM.dd, type=date}, sg_message_id={index=not_analyzed, type=string}, ip={index=not_analyzed, type=ip}, sg_event_id={index=not_analyzed, type=string}, event={index=not_analyzed, type=string}, email={fielddata={format=disabled}, index=analyzed, omit_norms=true, type=string, fields={domain={analyzer=email_domain_analyzer, index=analyzed, type=string}, raw={index=not_analyzed, type=string}}}, timestamp={format=epoch_second, type=date}}}]\"}},\"status\":400}"}

【问题讨论】:

    标签: api elasticsearch mapping


    【解决方案1】:

    看起来您正在运行 ES 7,而 sendgrid-event-logger 已经 4 年没有更新了。不再支持多种映射类型,默认映射类型现在命名为 _doc,而 sendgrid-event-logger 使用一个名为 log 的自定义映射类型。因此,您需要进行以下三项更改,它应该可以工作。

    1. lib/elasticsearch-template.json 中,只需在第 24 行更改以下内容:

    替换

    "log"
    

    "_doc"
    
    1. lib/parser.js 中,在第 43 行进行以下更改:

    拉普拉斯

    _type: 'log'
    

    _type: '_doc'
    
    1. lib/server.js 中,在第 43 行进行以下更改:

    拉普拉斯

    type: 'log'
    

    type: '_doc'
    

    它应该可以工作

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-09-06
      • 1970-01-01
      • 2018-01-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多