<!-- llms-explorer concept facts · https://llms-explorer.com/tree/mtools-log-analysis-integration/ · pack 2026-10-15 · ~3413 tokens -->

# mtools Log Analysis Integration

> Depth-first rabbithole dossier for mtools Log Analysis Integration; source-anchored research pack.

Parent: [FTDC and Log Tooling](https://llms-explorer.com/tree/ftdc-and-log-tooling/) · 4 facets · 33 facts · page: https://llms-explorer.com/tree/mtools-log-analysis-integration/

## Definitions

- [low] mtools is a collection of helper scripts to parse, filter, and visualize MongoDB log files (mongod, mongos), including tools like mlogfilter, mloginfo, mplotqueries, mlaunch, and mtransfer. Sources: https://github.com/rueckstiess/mtools — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/mtools-log-analysis-integration-4f2ab26fd7/rabbithole-synthesis.md#tools`

## How it works

- [low] mplotqueries supports an overlay mechanism to combine several plot types in one graphic, with overlays stored globally and persistently independent of the working directory. Sources: https://rueckstiess.github.io/mtools/mplotqueries.html — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/mtools-log-analysis-integration-4f2ab26fd7/rabbithole-synthesis.md#tools`
- [low] The mongod process quits if it is unable to write to the log file; users must verify that the log volume has disk space and that logs are rotated. Sources: https://www.mongodb.com/docs/manual/reference/log-messages.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/mtools-log-analysis-integration-4f2ab26fd7/rabbithole-synthesis.md#troubleshooting`

## Problems, failure modes and limitations

- [low] mlogfilter slices log files by time, merges log files, filters slow queries, finds table scans, shortens log lines, filters by other attributes, and converts logs to JSON. Sources: https://github.com/rueckstiess/mtools — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/mtools-log-analysis-integration-4f2ab26fd7/rabbithole-synthesis.md#tools`
- [low] mloginfo's distinct section groups log lines by message type using the 'log2code' matcher and prints the number of unmatched lines if any cannot be matched. Sources: https://rueckstiess.github.io/mtools/mloginfo.html — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/mtools-log-analysis-integration-4f2ab26fd7/rabbithole-synthesis.md#tools`
- [low] mloginfo's slow query log entry shows a value of 'True' or 'False' if disk was used, or 'None' if this information is not available in the log. Sources: https://rueckstiess.github.io/mtools/mloginfo.html — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/mtools-log-analysis-integration-4f2ab26fd7/rabbithole-synthesis.md#tools`
- [low] Slow operation log messages include a queryFramework field indicating the query engine: 'classic' for the classic engine and 'sbe' for the slot-based query engine. (verified as of 2026-10-15) Sources: https://www.mongodb.com/docs/manual/reference/log-messages.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/mtools-log-analysis-integration-4f2ab26fd7/rabbithole-synthesis.md#core`
- [low] Slow operation log messages and database profiler entries include a cpuNanos field specifying the total CPU time spent by a query operation in nanoseconds. (verified as of 2026-10-15) Sources: https://www.mongodb.com/docs/manual/reference/log-messages.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/mtools-log-analysis-integration-4f2ab26fd7/rabbithole-synthesis.md#core`
- [low] Slow query log messages contain new metrics prefixed by the query execution stage if the query execution writes temporary files to disk, such as sortSpills indicating the number of times. (verified as of 2026-10-15) Sources: https://www.mongodb.com/docs/manual/reference/log-messages.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/mtools-log-analysis-integration-4f2ab26fd7/rabbithole-synthesis.md#core`
- [low] MongoDB 8.3 introduces slow in-progress query log entries, logging queries at most once if the query's duration surpasses the threshold, containing less information than standard slow query logs. (verified as of 2026-10-15) Sources: https://www.mongodb.com/docs/manual/reference/log-messages.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/mtools-log-analysis-integration-4f2ab26fd7/rabbithole-synthesis.md#core`
- [low] Starting in MongoDB 5.0, log messages for slow queries on views include a resolvedViews field that contains the view details. (verified as of 2026-10-15) Sources: https://www.mongodb.com/docs/manual/reference/log-messages.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/mtools-log-analysis-integration-4f2ab26fd7/rabbithole-synthesis.md#core`
- [low] A single operation may log more than one entry; for example, if more than one write in a bulk write operation exceeds the slow operation threshold, each slow write is logged separately. Sources: https://www.mongodb.com/docs/manual/reference/log-messages.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/mtools-log-analysis-integration-4f2ab26fd7/rabbithole-synthesis.md#core`
- [low] The totalOplogSlotDurationMicros in the slow query log message shows the time between a write operation getting a commit timestamp and actually committing the storage engine writes. (verified as of 2026-10-15) Sources: https://www.mongodb.com/docs/manual/reference/log-messages.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/mtools-log-analysis-integration-4f2ab26fd7/rabbithole-synthesis.md#core`
- [low] The queryShapeHash field for a query shape is included in the slow query log when available. (verified as of 2026-10-15) Sources: https://www.mongodb.com/docs/manual/reference/log-messages.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/mtools-log-analysis-integration-4f2ab26fd7/rabbithole-synthesis.md#core`
- [low] mtools is not supported by MongoDB, Inc. under commercial support subscriptions, and usage is at the user's own risk. Sources: https://rueckstiess.github.io/mtools/mplotqueries.html — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/mtools-log-analysis-integration-4f2ab26fd7/rabbithole-synthesis.md#tools`
- [low] mplotqueries includes parameters to enable information about slow checkpoints under WiredTiger, slow DNS resolution, and slow oplog operations. Sources: https://rueckstiess.github.io/mtools/mplotqueries.html — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/mtools-log-analysis-integration-4f2ab26fd7/rabbithole-synthesis.md#tools`
- [low] mplotqueries allows grouping data by various attributes, with the group parameter specifying the grouping criteria, and can limit groups to the top N based on matching lines, grouping the rest into 'other'. Sources: https://rueckstiess.github.io/mtools/mplotqueries.html — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/mtools-log-analysis-integration-4f2ab26fd7/rabbithole-synthesis.md#tools`
- [low] A script using Pandas and Plotly creates data frames and a dashboard using the log file as input, limited to 10,000 queries with random sampling, and launches a web server on http://localhost:8050/. Sources: https://www.percona.com/blog/analyzing-slow-queries-after-mongodb-4-4/ — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/mtools-log-analysis-integration-4f2ab26fd7/rabbithole-synthesis.md#tools`
- [high] FTDC data forwarded by OTel or other log shipping pipelines cannot be used for diagnostic purposes, and standard log downloads typically provide only mongodb.gz and audit logs without FTDC data. Sources: https://www.mongodb.com/docs/manual/administration/full-time-diagnostic-data-capture.md, https://www.percona.com/blog/the-diagnostic-data-mongodb-atlas-doesnt-hand-you/ — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/mtools-log-analysis-integration-4f2ab26fd7/rabbithole-synthesis.md#troubleshooting`
- [low] Error messages sent to stderr, such as fatal errors during startup when not using file or syslog log destinations, are not affected by the log output destination setting. Sources: https://www.mongodb.com/docs/manual/reference/log-messages.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/mtools-log-analysis-integration-4f2ab26fd7/rabbithole-synthesis.md#troubleshooting`
- [low] In rare circumstances, a write can fail due to cache pressure, causing MongoDB to issue a TemporarilyUnavailable error and increment the temporarilyUnavailableErrors counter in the slow query log and FTDC data. Sources: https://www.mongodb.com/docs/manual/reference/parameters.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/mtools-log-analysis-integration-4f2ab26fd7/rabbithole-synthesis.md#troubleshooting`

## Facts and statements

- [low] Starting in MongoDB 4.4, mongod and mongos output all log messages in a new structured JSON format designed to be parseable using standard JSON libraries. (verified as of 2026-10-15) Sources: https://github.com/rueckstiess/mtools/issues/806 — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/mtools-log-analysis-integration-4f2ab26fd7/rabbithole-synthesis.md#core`
- [low] mloginfo returns information about log files, including start and end time, version, binary, and special sections like restarts, connections, and distinct views (requires numpy). Sources: https://github.com/rueckstiess/mtools — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/mtools-log-analysis-integration-4f2ab26fd7/rabbithole-synthesis.md#tools`
- [medium] mplotqueries visualizes log files with different types of plots and can group information in various ways (requires matplotlib). Sources: https://github.com/rueckstiess/mtools, https://rueckstiess.github.io/mtools/mplotqueries.html — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/mtools-log-analysis-integration-4f2ab26fd7/rabbithole-synthesis.md#tools`
- [low] mloginfo includes a transaction section that parses log files for transaction information (MongoDB 4.0+), including readConcern, TimeActiveMicros, TimeInactiveMicros, and duration fields. (verified as of 2026-10-15) Sources: https://rueckstiess.github.io/mtools/mloginfo.html — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/mtools-log-analysis-integration-4f2ab26fd7/rabbithole-synthesis.md#tools`
- [high] Keyhole (https://github.com/simagix/keyhole) is a reference tool that renders FTDC through Grafana, supports legacy MongoDB log formats, 4.4+ structured logs, and compressed FTDC data from MongoDB 3.2+. (verified as of 2026-10-15) Sources: https://www.percona.com/blog/the-diagnostic-data-mongodb-atlas-doesnt-hand-you/, https://github.com/rueckstiess/mtools/issues/806 — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/mtools-log-analysis-integration-4f2ab26fd7/rabbithole-synthesis.md#tools`
- mplotqueries and mloginfo do not support the logv2 format (MongoDB 4.4+) yet, despite MongoDB 4.4 introducing the structured JSON log format. Sources: https://github.com/rueckstiess/mtools/issues/806, https://rueckstiess.github.io/mtools/mplotqueries.html, https://rueckstiess.github.io/mtools/mloginfo.html — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/mtools-log-analysis-integration-4f2ab26fd7/rabbithole-synthesis.md#disagreements`
- [low] Log IDs (the fifth field in the JSON log output format) map to specific log events and can be relied upon to remain stable over successive MongoDB releases. Sources: https://www.mongodb.com/docs/manual/reference/log-messages.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/mtools-log-analysis-integration-4f2ab26fd7/rabbithole-synthesis.md#core`
- [low] mtools are currently tested with Python 3.8, 3.9, 3.10, and 3.11, and support MongoDB 4.4 or newer as of September 2023. (verified as of 2026-10-15) Sources: https://github.com/rueckstiess/mtools — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/mtools-log-analysis-integration-4f2ab26fd7/rabbithole-synthesis.md#tools`
- [low] mplotqueries can be used with shell pipe syntax, for example: mlogfilter logfile [parameters] | mplotqueries --type histogram. Sources: https://rueckstiess.github.io/mtools/mplotqueries.html — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/mtools-log-analysis-integration-4f2ab26fd7/rabbithole-synthesis.md#tools`
- [low] mplotqueries offers specific plot types including connection churn, duration line, event, histogram, range, replica set state, scatter, and scan ratio plots. Sources: https://rueckstiess.github.io/mtools/mplotqueries.html — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/mtools-log-analysis-integration-4f2ab26fd7/rabbithole-synthesis.md#tools`
- [low] mloginfo's default sort option is sum, and valid rounding values are from 0 to 4 decimal places with a default value of 1. Sources: https://rueckstiess.github.io/mtools/mloginfo.html — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/mtools-log-analysis-integration-4f2ab26fd7/rabbithole-synthesis.md#tools`
- [low] mloginfo outputs information if a cursor was reaped for exceeding the transaction timeout. Sources: https://rueckstiess.github.io/mtools/mloginfo.html — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/mtools-log-analysis-integration-4f2ab26fd7/rabbithole-synthesis.md#tools`

## Related concepts

- Log — is a part of mtools Log Analysis Integration
- mtools — is a part of mtools Log Analysis Integration
