Loading TOC...

xdmp.logmessageParse

xdmp.logmessageParse(
   messages as String[],
   format as String?,
   time-zone-offset as xs.duration?
) as Sequence

Summary

Parse messages from logfile to xml, json, raw, or complex (XML with more elements) format.

Parameters
messages The data from logfile.
format Output format - xml (default), json, raw, complex.
time-zone-offset Time Zone Offset, optional, not for raw format.

Required Privileges

http://marklogic.com/xdmp/privileges/xdmp-filesystem-file

Example

xdmp.logmessageParse(
  xdmp.logfileScan("file://host-in-cluster/var/opt/MarkLogic/Logs/ErrorLog.txt")
  , "json", xs.dayTimeDuration("PT4H"))
=>
{
"timestamp": "2021-09-09T15:54:45.293+04:00",
"level": "notice",
"message": "Starting MarkLogic Server 10.0-20210904 x86_64 in /opt/MarkLogic with data in /var/opt/MarkLogic"
}
{
"timestamp": "2021-09-09T15:54:45.296+04:00",
"level": "info",
"message": "MarkLogic Converters 10.0-20210825 found"
}
......

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.