Capture all lines from pattern till end, regex

Content:
<?xml version="1.0" encoding="UTF-16"?>
<joblog>
  <job_log_version version="2.0"/>
  <header>
    <start_time>Job started: Monday, August 10, 2020 at 1:00:05 PM</start_time>
  </header>
  <footer>
    <end_time>Job ended: Monday, August 10, 2020 at 3:17:50 PM</end_time>
    <OperationErrors Type="jobftr_jobcompl_shutdown">Job completion status: Canceled by service shutdown</OperationErrors>
    <completeStatus>1</completeStatus>
    <abortUserName>The job was canceled because the response to a media request alert was Cancel, or because the alert was configured to automatically respond with Cancel, or because the Backup Exec Job Engine service was stopped.</abortUserName>
  </footer>
</joblog>
To extract footer on Zabbix 4.0 can use RegEx together with XPath. RegEx extact group 0:
<joblog>((.*)(\n)?)+
Xpath:
//footer[1]
Screenshot:

No comments: