有个人长的像洋葱,走着走着就哭了…….

logstash解析xml

Logstash | 作者 yangjiajun111 | 发布于2018年01月08日 | 阅读数:2717

logstash解析xml得到的单个字段是一个数组,有什么办法不存为数组吗
已邀请:

诺岚

赞同来自:

我也有一个XMl文件,该如何解析,迷茫中
 

诺岚

赞同来自:


<?xml version="1.0" encoding="UTF-8"?>
<IPC2547Event><ProcessSessionStart dateTime="2017-09-07T10:39:30.00+08:00" sessionId="S_20200008618100002_1504751985"><Product itemType="852RN5691MB2003"/>
<Entity stationId="TBA7150495" stage="AOI"/>
<Recipe recipeId="852RN5691MB2003.tst" revision="2017-09-07T09:42:35.00+08:00">
<RecipeModule moduleId="456.bib" revision="2017-09-07T09:43:03.00+08:00"/>
</Recipe></ProcessSessionStart>
<ItemProcessStatus dateTime="2017-09-07T10:39:30.00+08:00" itemInstanceId="20200008618100002" sessionRef="S_20200008618100002_1504751985" itemProcessId="20200008618100002_1504751985" status="PASSED">
<ItemEventCount eventType="PROCESSSTEPSTATUS" count="2"/>
</ItemProcessStatus><ProcessStepStatus dateTime="2017-09-07T10:39:30.00+08:00" itemInstanceId="20200008618100002" sessionRef="S_20200008618100002_1504751985" itemProcessRef="20200008618100002_1504751985" processStepId="20200008618100002_1" status="PASSED" imageId="1"/>
<ProcessStepStatus dateTime="2017-09-07T10:39:30.00+08:00" itemInstanceId="20200008618100002" sessionRef="S_20200008618100002_1504751985" itemProcessRef="20200008618100002_1504751985" processStepId="20200008618100001" status="PASSED" imageId="2"/>
</IPC2547Event>

诺岚

赞同来自:

该如何解析,获取到里面的数字与状态
 

yangjiajun111

赞同来自:

看logstash解析xml插件,然后用xpath就能拿到那些属性

要回复问题请先登录注册