当我尝试使用Logstash在ElasticSearch中导入以下XML文件时出现问题:
<test>
<param name="param1" raw="0x01">
<param name="param2" raw="0x02" eng="2">
<param name="param3" raw="0x03" eng="3">
</test>
我的Logstash配置文件如下(摘录):
xml {
store_xml => false
source => "message"
xpath => [
"/test/param/@name", "name",
"/test/param/@raw", "raw",
"/test/param/@eng", "eng"
]
}
运行Logstash后,ElasticSearch数据库包含:
"name": [
"param1",
"param2",
"param3",
],
"raw": [
"0x01",
"0x02",
"0x02",
],
"eng": [
2,
3,
],
我想要这个:
...
"eng": [
null,
2,
3,
],
如何在非现有字段中强制使用null(或None或NaN)值?
提前致谢!