Hi everyone,
So i'm struggling with an xml (log file) where we get information about some devices, so the logfile is filled with multiple "blocks" like that.
Based on the <devId> i want to extract this part of the xml file. If possible I want it to have an script for this, cause we'll use this function quite a lot.
Already tried with grep, but i only get the line with the devId which isn't the result i want.
Tried to fiddle with xmllint but my knowledge isn't that advanced to play with it.
2019-06-16 20:20:11,695 | INFO | CHEDULER_TOVSDC] | vsdc | 94 - org.apache.camel.camel-core - 2.17.3 | There is no task ack to send
2019-06-16 20:20:11,901 | INFO | r[VSDCFE_ALARMS] | vsdc | 94 - org.apache.camel.camel-core - 2.17.3 | VSDCFE_ALARMS: Device alarm isssue message received contains {"time":"2019-06-16T18:20:10","deviceId":"number","alarms":[{"obis":"0;0;97;98;20;255","attributeId":"2","classId":"1","value":"0600000000"},{"obis":"0;0;97;98;21;255","attributeId":"2","classId":"1","value":"0600000000"},{"obis":"0;0;97;98;22;255","attributeId":"2","classId":"1","value":"0600800000"}]}
2019-06-16 20:20:11,914 | INFO | r[VSDCFE_ALARMS] | AlarmTaskProcessor | 237 - vsdc-alarm-manager - 2.0.83.43 | Alarm descriptor value is <= 0
2019-06-16 20:20:11,914 | INFO | r[VSDCFE_ALARMS] | AlarmTaskProcessor | 237 - vsdc-alarm-manager - 2.0.83.43 | Alarm descriptor value is <= 0
2019-06-16 20:20:11,914 | INFO | r[VSDCFE_ALARMS] | vsdc | 94 - org.apache.camel.camel-core - 2.17.3 | Sending alarm device task request xml to task manager: <?xml version="1.0" encoding="UTF-8"?>
<taskReq
xmlns=""
taskId="ALARM_number_1560709211907" taskType="DLMS" version="4" isActivation="false"
execPriority="3">
<targets>
<devID>number</devID>
</targets>
<schedule>
<start>2019-06-16T20:23:11.907+02:00</start>
<stop>2019-06-16T21:20:11.908+02:00</stop>
</schedule>
<dlmsParams mode="unicast">
<unicast timeout="45" maxTry="0" />
</dlmsParams>
<resultParams>
<priority>urgent</priority>
<mode>all</mode>
<useCache>none</useCache>
</resultParams>
<transactions count="1">
<transaction id="1">
<dlms operation="SETM" association="1" >
<setm order="1" obis="0;0;97;98;22;255" attribute="2" classId="1">
<xdr>0600800000</xdr>
</setm>
<setm order="2" obis="0;0;97;98;2;255" attribute="2" classId="1">
<xdr>0600000000</xdr>
</setm>
</dlms>
</transaction>
</transactions>
</taskReq>
2019-06-16 20:20:11,938 | INFO | ActiveMQ Task-1 | FailoverTransport | 77 - org.apache.activemq.activemq-osgi - 5.12.1 | Successfully connected to
2019-06-16 20:20:11,950 | INFO | CHEDULER_TOVSDC] | TaskProcessor | 246 - vsdc-task-manager - 2.0.83.43 | Task Scheduling validation
2019-06-16 20:20:11,952 | INFO | CHEDULER_TOVSDC] | TaskProcessor | 246 - vsdc-task-manager - 2.0.83.43 | save task taskid ALARM_number_1560709211907
2019-06-16 20:20:11,956 | INFO | r[VSDCFE_ALARMS] | DeviceIssueAlarmProcessor | 237 - vsdc-alarm-manager - 2.0.83.43 | Starting device issue alarm process
2019-06-16 20:20:11,961 | INFO | CHEDULER_TOVSDC] | SchedulerProcessor | 246 - vsdc-task-manager - 2.0.83.43 | schedule creator for Task taskId: ALARM_number_1560709211907
2019-06-16 20:20:11,961 | INFO | r[VSDCFE_ALARMS] | ldnFromDinAdapterRouteAlarm | 94 - org.apache.camel.camel-core - 2.17.3 | message send from vsdc : <?xml version="1.0" encoding="UTF-8"?><alarms xmlns="">
<deviceAlarms>
<alarm devId="number" obis="0;0;97;98;20;255" classId="1" attribute="2" time="2019-06-16T20:20:10.000+02:00">0600000000</alarm>
<alarm devId="number" obis="0;0;97;98;21;255" classId="1" attribute="2" time="2019-06-16T20:20:10.000+02:00">0600000000</alarm>
<alarm devId="number" obis="0;0;97;98;22;255" classId="1" attribute="2" time="2019-06-16T20:20:10.000+02:00">0600800000</alarm>
</deviceAlarms>
</alarms>
2019-06-16 20:20:11,961 | INFO | CHEDULER_TOVSDC] | SchedulerProcessor | 246 - vsdc-task-manager - 2.0.83.43 | NON PERIODIC
2019-06-16 20:20:11,962 | INFO | CHEDULER_TOVSDC] | SchedulerProcessor | 246 - vsdc-task-manager - 2.0.83.43 | prepare Scheduling taskId [ALARM_number_1560709211907]
2019-06-16 20:20:11,962 | INFO | CHEDULER_TOVSDC] | JobsDatePlannerServiceImpl | 246 - vsdc-task-manager - 2.0.83.43 | First creator execution Date: 2019-06-16T20:22:11.907+02:00
2019-06-16 20:20:11,962 | INFO | CHEDULER_TOVSDC] | SchedulerProcessor | 246 - vsdc-task-manager - 2.0.83.43 | STOP DATE = 2019-06-16T21:20:11.908+02:00
2019-06-16 20:20:11,963 | INFO | ActiveMQ Task-1 | FailoverTransport | 77 - org.apache.activemq.activemq-osgi - 5.12.1 | Successfully connected to
2019-06-16 20:20:11,974 | INFO | CHEDULER_TOVSDC] | SchedulerProcessor | 246 - vsdc-task-manager - 2.0.83.43 | schedule finalizer for Task taskId: ALARM_number_1560709211907
2019-06-16 20:20:11,975 | INFO | CHEDULER_TOVSDC] | SchedulerProcessor | 246 - vsdc-task-manager - 2.0.83.43 | NON PERIODIC
2019-06-16 20:20:11,975 | INFO | r[VSDCFE_ALARMS] | vsdmc | 94 - org.apache.camel.camel-core - 2.17.3 | Device alarm message is sent to M2M containing <?xml version="1.0" encoding="UTF-8"?><alarms xmlns="">
<deviceAlarms>
<alarm devId="number" obis="0;0;97;98;20;255" classId="1" attribute="2" time="2019-06-16T20:20:10.000+02:00">0600000000</alarm>
<alarm devId="number" obis="0;0;97;98;21;255" classId="1" attribute="2" time="2019-06-16T20:20:10.000+02:00">0600000000</alarm>
<alarm devId="number" obis="0;0;97;98;22;255" classId="1" attribute="2" time="2019-06-16T20:20:10.000+02:00">0600800000</alarm>
</deviceAlarms>
</alarms>