logstash-input-file 读取xml 为啥通过"/xmldata/head2/key3/text()", "key3" 类似的解析,字段keys3是数组啊
Logstash | 作者 jiping | 发布于2020年10月27日 | 阅读数:1668
filter 关于xml的配置
xml{
store_xml =>false
source => "message"
xpath => [
"/xmldata/head1/id/text()", "id",
"/xmldata/head1/date/text()", "date",
"/xmldata/head1/key1/text()", "key1",
"/xmldata/head2/key3/text()", "key3"
]
}
xml文件:
<xmldata>
<head1>
<key1>Value1</key1>
<key2>Value2</key2>
<id>0001</id>
<date>Aug 13 2011 00:03:44</date>
</head1>
<head2>
<key3>Value3</key3>
</head2>
</xmldata>
结果拿到的结果每个字段却是数组,我想要是的string
该如何配置?
xml{
store_xml =>false
source => "message"
xpath => [
"/xmldata/head1/id/text()", "id",
"/xmldata/head1/date/text()", "date",
"/xmldata/head1/key1/text()", "key1",
"/xmldata/head2/key3/text()", "key3"
]
}
xml文件:
<xmldata>
<head1>
<key1>Value1</key1>
<key2>Value2</key2>
<id>0001</id>
<date>Aug 13 2011 00:03:44</date>
</head1>
<head2>
<key3>Value3</key3>
</head2>
</xmldata>
结果拿到的结果每个字段却是数组,我想要是的string
该如何配置?
1 个回复
liuxg - Elastic
赞同来自: