MarkLogic 12 EA 1 Product Documentation
xdmp.logfileScan

xdmp.logfileScan(
   path as String,
   match-pattern as String?,
   match-flags as String?,
   start-date as Date?,
   end-date as Date?,
   limit as Number?
) as Sequence

Summary

Scan a file in ErrorLog.txt format filtering by date range and regular expression.

Parameters
path The path to the log file on the local or cluster filesystem.
match-pattern Regular expression to match against log lines.
match-flags Regex match flags.
start-date Filter (discard) log records before $start-date.
end-date Stop matching (discard) log records on or after end-date.
limit Log lines limit.

Required Privileges

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

Example

xdmp.logfileScan("file://host-in-cluster/var/opt/MarkLogic/Logs/ErrorLog.txt",
                 "Info", null, xs.dateTime("2021-09-09T15:54:45.294"), null, 3)
=>
2021-09-09 15:54:45.296 Info: MarkLogic Converters 10.0-20210825 found
2021-09-09 15:54:45.485 Info: Host host-in-cluster with 32GB memory running Linux 5.7.15-100.fc31.x86_64 (Fedora release 31 (Thirty One))
2021-09-09 15:54:45.984 Info: License key languages: en fr it de es zh-Hant zh ar ru nl ko fa ja pt nb nn sv
Powered by MarkLogic Server | Terms of Use | Privacy Policy