我想将用户的输入记录到我的RESTful API以进行调试,但只要JSON有效负载中有空字段,就会生成错误并丢弃日志。
例如,
{
"extra": {
"request": {
"body": {
"": ""
}
}
}
}
...将导致
{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "failed to parse"
}
],
"type": "mapper_parsing_exception",
"reason": "failed to parse",
"caused_by": {
"type": "illegal_argument_exception",
"reason": "field name cannot be an empty string"
}
},
"status": 400
}
它有点棘手,因为它发生在解析阶段......是否有任何解决方法可以删除/重命名这些字段,以便它可以使ES能够消化这些日志?