Stack traces
Find the Java and Python stack traces in an application log and group the same errors together, with the number of times each one happened, its first and last time, the top frames, the chain of causes and a fingerprint that ignores line numbers and ids. Typical uses: send each morning the list of new errors of the night, see which error is the most frequent after a release, follow an error from one day to the next with its fingerprint.
log exceptions <text>
Description
Group the stack traces of a log text: {lines, exceptions, groups, not_grouped (beyond max_groups), truncated, rows: [{fingerprint, language, exception, message, message_template, count, first_seen, last_seen, first_line, distinct_messages, frames, causes: [{exception, message, frames}], root_cause}]} sorted by count, then by first line
Group the stack traces of a log text: {lines, exceptions, groups, not_grouped (beyond max_groups), truncated, rows: [{fingerprint, language, exception, message, message_template, count, first_seen, last_seen, first_line, distinct_messages, frames, causes: [{exception, message, frames}], root_cause}]} sorted by count, then by first line
Parameters
text: The log lines (a text without a real line break may separate its lines with the two characters \n; such a \n inside a double-quoted value is kept when the quote closes within the next 8 lines) - String - required
text: The log lines (a text without a real line break may separate its lines with the two characters \n; such a \n inside a double-quoted value is kept when the quote closes within the next 8 lines) - String - required
admin
log exceptions "2026-11-03 10:00:00,123 ERROR [pool-1] OrderJob - job failed java.lang.IllegalStateException: cannot load order 1000 at com.shop.OrderRepo.load(OrderRepo.java:52) at com.shop.OrderService.lambda$run$0(OrderService.java:31) at com.shop.OrderJob.main(OrderJob.java:11) Caused by: java.io.IOException: connection reset by 10.0.0.12:5432 at com.shop.Db.query(Db.java:88) ... 3 more 2026-11-03 10:07:00,456 ERROR [pool-2] OrderJob - job failed java.lang.IllegalStateException: cannot load order 1077 at com.shop.OrderRepo.load(OrderRepo.java:54) at com.shop.OrderService.lambda$run$1(OrderService.java:31) at com.shop.OrderJob.main(OrderJob.java:11) Caused by: java.io.IOException: connection reset by 10.0.0.13:5432 at com.shop.Db.query(Db.java:90) 2026-11-03 10:09:00,000 WARN [main] Report - empty java.lang.NullPointerException at com.shop.Report.total(Report.java:12)"
mentdb
{"lines": 18, "exceptions": 3, "groups": 2, "not_grouped": 0, "truncated": false, "rows": [{"fingerprint": "45b347baf08e092f", "language": "java", "exception": "java.lang.IllegalStateException", "message": "cannot load order 1000", "message_template": "cannot load order <n>", "count": 2, "first_seen": "2026-11-03T10:00:00.123+00:00", "last_seen": "2026-11-03T10:07:00.456+00:00", "first_line": 2, "distinct_messages": 1, "frames": ["com.shop.OrderRepo.load(OrderRepo.java:52)", "com.shop.OrderService.lambda$run$0(OrderService.java:31)", "com.shop.OrderJob.main(OrderJob.java:11)"], "causes": [{"exception": "java.io.IOException", "message": "connection reset by 10.0.0.12:5432", "frames": ["com.shop.Db.query(Db.java:88)"]}], "root_cause": "java.io.IOException: connection reset by 10.0.0.12:5432"}, {"fingerprint": "6c5120c1071f3940", "language": "java", "exception": "java.lang.NullPointerException", "message": null, "message_template": null, "count": 1, "first_seen": "2026-11-03T10:09:00.000+00:00", "last_seen": "2026-11-03T10:09:00.000+00:00", "first_line": 17, "distinct_messages": 1, "frames": ["com.shop.Report.total(Report.java:12)"], "causes": [], "root_cause": "java.lang.NullPointerException"}]}
A chained Python exception
admin
log exceptions "2026-11-03 09:00:00,001 ERROR job failed Traceback (most recent call last): File \"/srv/app/jobs.py\", line 7, in run load(i) File \"/srv/app/jobs.py\", line 4, in load return cache[key] KeyError: 'k42' The above exception was the direct cause of the following exception: Traceback (most recent call last): File \"/srv/app/jobs.py\", line 9, in run raise RuntimeError(f\"order {i} failed\") from e RuntimeError: order 42 failed"
mentdb
{"lines": 14, "exceptions": 1, "groups": 1, "not_grouped": 0, "truncated": false, "rows": [{"fingerprint": "34b67a4c43397f3f", "language": "python", "exception": "RuntimeError", "message": "order 42 failed", "message_template": "order <n> failed", "count": 1, "first_seen": "2026-11-03T09:00:00.001+00:00", "last_seen": "2026-11-03T09:00:00.001+00:00", "first_line": 2, "distinct_messages": 1, "frames": ["run (/srv/app/jobs.py:9)"], "causes": [{"exception": "KeyError", "message": "'k42'", "frames": ["load (/srv/app/jobs.py:4)", "run (/srv/app/jobs.py:7)"]}], "root_cause": "KeyError: 'k42'"}]}
log exceptions <text> <json_params>
Description
Group the stack traces with parameters: frames (5: frames given for each exception and cause, 0 to 100), fingerprint_frames (10), with_message (false), max_groups (1000), timezone (UTC), year (for the syslog dates), output (full, or groups: only the rows), max_lines (10000000), line_max (65536), timeout_ms (60000: the whole reading, also inside a very long line)
Group the stack traces with parameters: frames (5: frames given for each exception and cause, 0 to 100), fingerprint_frames (10), with_message (false), max_groups (1000), timezone (UTC), year (for the syslog dates), output (full, or groups: only the rows), max_lines (10000000), line_max (65536), timeout_ms (60000: the whole reading, also inside a very long line)
Parameters
text: The log lines (a text without a real line break may separate its lines with the two characters \n; such a \n inside a double-quoted value is kept when the quote closes within the next 8 lines) - String - required
json_params: The parameters - String - required
text: The log lines (a text without a real line break may separate its lines with the two characters \n; such a \n inside a double-quoted value is kept when the quote closes within the next 8 lines) - String - required
json_params: The parameters - String - required
admin
log exceptions "2026-11-03 10:00:00,123 ERROR [pool-1] OrderJob - job failed java.lang.IllegalStateException: cannot load order 1000 at com.shop.OrderRepo.load(OrderRepo.java:52) at com.shop.OrderService.lambda$run$0(OrderService.java:31) at com.shop.OrderJob.main(OrderJob.java:11) Caused by: java.io.IOException: connection reset by 10.0.0.12:5432 at com.shop.Db.query(Db.java:88) ... 3 more 2026-11-03 10:07:00,456 ERROR [pool-2] OrderJob - job failed java.lang.IllegalStateException: cannot load order 1077 at com.shop.OrderRepo.load(OrderRepo.java:54) at com.shop.OrderService.lambda$run$1(OrderService.java:31) at com.shop.OrderJob.main(OrderJob.java:11) Caused by: java.io.IOException: connection reset by 10.0.0.13:5432 at com.shop.Db.query(Db.java:90) 2026-11-03 10:09:00,000 WARN [main] Report - empty java.lang.NullPointerException at com.shop.Report.total(Report.java:12)" "{\"frames\": 1, \"output\": \"groups\"}"
mentdb
[{"fingerprint": "45b347baf08e092f", "language": "java", "exception": "java.lang.IllegalStateException", "message": "cannot load order 1000", "message_template": "cannot load order <n>", "count": 2, "first_seen": "2026-11-03T10:00:00.123+00:00", "last_seen": "2026-11-03T10:07:00.456+00:00", "first_line": 2, "distinct_messages": 1, "frames": ["com.shop.OrderRepo.load(OrderRepo.java:52)"], "causes": [{"exception": "java.io.IOException", "message": "connection reset by 10.0.0.12:5432", "frames": ["com.shop.Db.query(Db.java:88)"]}], "root_cause": "java.io.IOException: connection reset by 10.0.0.12:5432"}, {"fingerprint": "6c5120c1071f3940", "language": "java", "exception": "java.lang.NullPointerException", "message": null, "message_template": null, "count": 1, "first_seen": "2026-11-03T10:09:00.000+00:00", "last_seen": "2026-11-03T10:09:00.000+00:00", "first_line": 17, "distinct_messages": 1, "frames": ["com.shop.Report.total(Report.java:12)"], "causes": [], "root_cause": "java.lang.NullPointerException"}]
with_message: the template of the message enters the fingerprint, the numbers of the messages still do not count
admin
log exceptions "2026-11-03 10:00:00,123 ERROR [pool-1] OrderJob - job failed java.lang.IllegalStateException: cannot load order 1000 at com.shop.OrderRepo.load(OrderRepo.java:52) at com.shop.OrderService.lambda$run$0(OrderService.java:31) at com.shop.OrderJob.main(OrderJob.java:11) Caused by: java.io.IOException: connection reset by 10.0.0.12:5432 at com.shop.Db.query(Db.java:88) ... 3 more 2026-11-03 10:07:00,456 ERROR [pool-2] OrderJob - job failed java.lang.IllegalStateException: cannot load order 1077 at com.shop.OrderRepo.load(OrderRepo.java:54) at com.shop.OrderService.lambda$run$1(OrderService.java:31) at com.shop.OrderJob.main(OrderJob.java:11) Caused by: java.io.IOException: connection reset by 10.0.0.13:5432 at com.shop.Db.query(Db.java:90) 2026-11-03 10:09:00,000 WARN [main] Report - empty java.lang.NullPointerException at com.shop.Report.total(Report.java:12)" "{\"with_message\": true, \"frames\": 0, \"output\": \"groups\"}"
mentdb
[{"fingerprint": "86ce944af59e8f3d", "language": "java", "exception": "java.lang.IllegalStateException", "message": "cannot load order 1000", "message_template": "cannot load order <n>", "count": 2, "first_seen": "2026-11-03T10:00:00.123+00:00", "last_seen": "2026-11-03T10:07:00.456+00:00", "first_line": 2, "distinct_messages": 1, "frames": [], "causes": [{"exception": "java.io.IOException", "message": "connection reset by 10.0.0.12:5432", "frames": []}], "root_cause": "java.io.IOException: connection reset by 10.0.0.12:5432"}, {"fingerprint": "a18bf8a7223ce4e0", "language": "java", "exception": "java.lang.NullPointerException", "message": null, "message_template": null, "count": 1, "first_seen": "2026-11-03T10:09:00.000+00:00", "last_seen": "2026-11-03T10:09:00.000+00:00", "first_line": 17, "distinct_messages": 1, "frames": [], "causes": [], "root_cause": "java.lang.NullPointerException"}]
Used in use cases (1 recipe)
Debugging & error handling › Group the errors of the night in a Java log and find their root cause
Debugging & error handling › Group the errors of the night in a Java log and find their root cause
log exceptions_file <path>
Description
Group the stack traces of a log file read as a stream (a .gz file too)
Group the stack traces of a log file read as a stream (a .gz file too)
Parameters
path: The log file (UTF-8 by default, a .gz file is read as it is), same rights as file load - String - required
path: The log file (UTF-8 by default, a .gz file is read as it is), same rights as file load - String - required
admin
if (equal (file exist "tmp/doc_logs") "0") {file mkdir "tmp/doc_logs";}; -> "[nl]" (string char 10); -> "[log]" (concat "2026-11-03 10:00:00 ERROR job failed" [nl] "java.lang.IllegalStateException: order 1000" [nl] " at com.shop.Repo.load(Repo.java:52)" [nl] "2026-11-03 10:05:00 ERROR job failed" [nl] "java.lang.IllegalStateException: order 1077" [nl] " at com.shop.Repo.load(Repo.java:54)" [nl]); file create "tmp/doc_logs/app.log" [log]; json load "doc_ex" (log exceptions_file "tmp/doc_logs/app.log"); -> "[res]" (concat (json select "doc_ex" "/rows/[0]/exception") " x" (json select "doc_ex" "/rows/[0]/count") " from " (json select "doc_ex" "/rows/[0]/first_seen") " to " (json select "doc_ex" "/rows/[0]/last_seen")); json unload "doc_ex"; file delete "tmp/doc_logs/app.log"; [res]
mentdb
java.lang.IllegalStateException x2 from 2026-11-03T10:00:00+00:00 to 2026-11-03T10:05:00+00:00
log exceptions_file <path> <json_params>
Description
Group the stack traces of a log file with the parameters of log exceptions, and charset (UTF-8), max_bytes (104857600, counted after decompression)
Group the stack traces of a log file with the parameters of log exceptions, and charset (UTF-8), max_bytes (104857600, counted after decompression)
Parameters
path: The log file (UTF-8 by default, a .gz file is read as it is), same rights as file load - String - required
json_params: The parameters - String - required
path: The log file (UTF-8 by default, a .gz file is read as it is), same rights as file load - String - required
json_params: The parameters - String - required
admin
log exceptions_file "tmp/doc_logs/none.log" "{\"frames\": 3}"
mentdb
ERROR: Sorry, an error appears (the file 'tmp/doc_logs/none.log' does not exist).
