elasticsearch - Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"mall_log-2020.09", :routing=>nil, :_type=>"_doc"}, #LogStash::Event:0x52c34e1a], :response=>{"index"=>{"_index"=>"mall_log-2020.09", "_type"=>"_doc", "_id"=>"ooXltHQB7mt-ptSVRD3B", "status"=>400, "error"=>{"type"=>"mapper_parsing_exception", "reason"=>"object mapping for [Data] tried to parse field [Data] as object, but found a concrete value"}}}}
I sent two pieces of data to ES and produced different results. Why is the structure of error rejected by ES?
info message
{"SourceType":"IntegralMallLog","LogLevel":"info","ApiName":"OrderStartDelivery","ApiUrl":"https://xxxx//api/IntegralMall/Order/OrderStartDelivery","Token":"","Data":{"requestdto":{"expressNum":"SF1100545","expressInfo":"[\r\n {\r\n "salesId": "202398",\r\n "pid": "2100010027",\r\n "pnum": 1.0,\r\n "expressRemark": "x"\r\n },\r\n {\r\n "salesId": "2020091399",\r\n "pid": "21000132",\r\n "pnum": 2.0,\r\n "expressRemark": "x"\r\n },\r\n {\r\n "salesId": "20200900",\r\n "pid": "21000028",\r\n "pnum": 1.0,\r\n "expressRemark": "x"\r\n }\r\n]"}}}
error message
{"SourceType":"IntegralMallLog","LogLevel":"error","ApiName":"1111","ApiUrl":"1111","Token":null,"Data":"2323"}
mapping
{
"mall_log-2020.09" : {
"mappings" : {
"properties" : {
"@timestamp" : {
"type" : "date"
},
"@version" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"ApiName" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"ApiUrl" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"Data" : {
"properties" : {
"errordata" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"exception" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"requestdto" : {
"properties" : {
"address" : {
"properties" : {
"address" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"city" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"county" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"receiverName" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"receiverPhone" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"state" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"street" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
}
},
"confirmed" : {
"type" : "long"
},
"custAccount" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"description" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"dlvModeId" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"expressInfo" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"expressNum" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"salesCode" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"salesLine" : {
"properties" : {
"description" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"free" : {
"type" : "long"
},
"freightByCust" : {
"type" : "long"
},
"itemId" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"lineAmount" : {
"type" : "float"
},
"lineAmountAgent" : {
"type" : "float"
},
"lineId" : {
"type" : "long"
},
"pcsQty" : {
"type" : "float"
},
"peopleQty" : {
"type" : "float"
},
"priceUnit" : {
"type" : "float"
},
"qty" : {
"type" : "float"
},
"qualityDays" : {
"type" : "float"
},
"qualityQty" : {
"type" : "float"
},
"salesLineDisc" : {
"type" : "float"
},
"salesPrice" : {
"type" : "float"
},
"salesPriceAgent" : {
"type" : "float"
}
}
},
"salesPoolId" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"sourceType" : {
"type" : "long"
}
}
},
"responsedto" : {
"properties" : {
"__abp" : {
"type" : "boolean"
},
"error" : {
"properties" : {
"code" : {
"type" : "long"
},
"message" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
}
},
"result" : {
"properties" : {
"salesId" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
}
},
"success" : {
"type" : "boolean"
},
"unAuthorizedRequest" : {
"type" : "boolean"
}
}
}
}
},
"LogLevel" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"SourceType" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"Token" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"message" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"tags" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
}
}
}
}