Hi experts,
I have parsed the XML file and get some useful NODEs' information, they are saved as a array format. I want to draw a trend chart by using Kibana, but I can't draw it because all of data are saved as array format. Would you please help me solve this block issue?
The input XML files shows as below:
<?xml version="1.0" encoding="UTF-8"?>
<OMeS version="2.3">
<PMSetup startTime="2018-03-09T08:15:00.000+01:00" interval="5">
<PMMOResult>
<MO dimension="network_element">
<DN>NTAS-tas01/HOSTNAME-cbam-4c63de7aeae2460289cd4197dc7-admintd-node-0/DBTYPE-cmdb</DN>
</MO>
<PMTarget measurementType="DBMEAS">
<M704B1C1>32</M704B1C1>
<M704B1C2>188</M704B1C2>
<M704B1C3>0</M704B1C3>
<M704B1C4>0</M704B1C4>
</PMTarget>
</PMMOResult>
<PMMOResult>
<MO dimension="network_element">
<DN>NTAS-tas01/HOSTNAME-cbam-4c63de7aeae2460289cd4197dc7-admintd-node-1/DBTYPE-cmdb</DN>
</MO>
<PMTarget measurementType="DBMEAS">
<M704B1C1>30</M704B1C1>
<M704B1C2>116</M704B1C2>
<M704B1C3>0</M704B1C3>
<M704B1C4>1</M704B1C4>
... ...(about 19 similar node)... ...
The paresd XML pattern shows as below:
xpath => [
"/OMeS/PMSetup/@startTime", "audit_time",
"/OMeS/PMSetup/PMMOResult/MO/@dimension", "ELKNE",
"/OMeS/PMSetup/PMMOResult/MO/DN/text()", "ELKDN",
"/OMeS/PMSetup/PMMOResult/PMTarget/@measurementType", "ELKPMtype",
"/OMeS/PMSetup/PMMOResult/PMTarget/M704B1C1/text()", "ELKPV1",
]
The parsed output shows as below:
"audit_time": [
"2018-03-09T07:50:00.000+01:00"
],
"ELKPV1": [
"32",
"36",
"33",
"34",
"36",
"35",
"34",
"7",
"40",
"6",
"32",
"8",
"33",
"34",
"34",
"36",
"33",
"35",
"33"
]
"ELKDN": [
"NTAS-tas01/HOSTNAME-cbam-4c63de7aeae2460289cd4197dc7-admintd-node-0/DBTYPE-cmdb",
"NTAS-tas01/HOSTNAME-cbam-4c63de7aeae2460289cd4197dc7-admintd-node-1/DBTYPE-cmdb",
"NTAS-tas01/HOSTNAME-cbam-4c63de7aeae2460289cd4197dc7-amc-node-0/DBTYPE-cmdb",
"NTAS-tas01/HOSTNAME-cbam-4c63de7aeae2460289cd4197dc7-db-node-0/DBTYPE-cmdb",
"NTAS-tas01/HOSTNAME-cbam-4c63de7aeae2460289cd4197dc7-dtd-node-0/DBTYPE-cmdb",
"NTAS-tas01/HOSTNAME-cbam-4c63de7aeae2460289cd4197dc7-l4td-node-0/DBTYPE-cmdb",
"NTAS-tas01/HOSTNAME-cbam-4c63de7aeae2460289cd4197dc7-oam-node-1/DBTYPE-cmdb",
"NTAS-tas01/HOSTNAME-cbam-4c63de7aeae2460289cd4197dc7-oam-node-1/DBTYPE-gls-cmdb",
"NTAS-tas01/HOSTNAME-cbam-4c63de7aeae2460289cd4197dc7-oam-node-2/DBTYPE-cmdb",
"NTAS-tas01/HOSTNAME-cbam-4c63de7aeae2460289cd4197dc7-oam-node-2/DBTYPE-gls-cmdb",
"NTAS-tas01/HOSTNAME-cbam-4c63de7aeae2460289cd4197dc7-oam-node-3/DBTYPE-cmdb",
"NTAS-tas01/HOSTNAME-cbam-4c63de7aeae2460289cd4197dc7-oam-node-3/DBTYPE-gls-cmdb",
"NTAS-tas01/HOSTNAME-cbam-4c63de7aeae2460289cd4197dc7-smd-node-0/DBTYPE-cmdb",
"NTAS-tas01/HOSTNAME-cbam-4c63de7aeae2460289cd4197dc7-spfe-node-0/DBTYPE-cmdb",
"NTAS-tas01/HOSTNAME-cbam-4c63de7aeae2460289cd4197dc7-storage-node-0/DBTYPE-cmdb",
"NTAS-tas01/HOSTNAME-cbam-4c63de7aeae2460289cd4197dc7-storage-node-1/DBTYPE-cmdb",
"NTAS-tas01/HOSTNAME-cbam-4c63de7aeae2460289cd4197dc7-storage-node-2/DBTYPE-cmdb",
"NTAS-tas01/HOSTNAME-cbam-4c63de7aeae2460289cd4197dc7-tafe-node-0/DBTYPE-cmdb",
"NTAS-tas01/HOSTNAME-cbam-4c63de7aeae2460289cd4197dc7-tafe-node-1/DBTYPE-cmdb"
]
Now I want to transfer them like a CSV format, such like below:
audit_time ELKDN ELKPV1
v1 v1 v1
v1 v2 v2
v1 v3 v3
v1 v4 v4
... ...
as we known, audit_time is only one value, other field includes 19 values, how can I transfer them to the above format?
Thank you.