elasticsearch - 如何处理 ElasticSearch 中的空字段名称?
问题描述
我想将用户的输入记录到我的 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 消化这些日志?
解决方案
推荐阅读
- java - 如何在java中从double转换为大于long的值
- angular - 错误 TS1127:在 Angular 7 中运行 Karma 测试时出现无效字符
- keras - 使用 ImageGenerator 时可以禁用图像大小调整吗?
- matlab - 定点迭代法错误MATLAB
- python - 根据 python pandas 数据框中其他列的值计算新列
- pyqt5 - 如何在pyqt5中区分背景和前景
- spring-boot - 我如何在春季启动中为百里香设置前缀路径
- flutter - 我在 YAML 文件中提到了插件,但在 Xcode 中仍然遇到问题
- jquery - jquery toggleClass 视图没有变化
- reactjs - 无法在reactjs中呈现数据表的数据