mongo-x-ray-log
MongoDB log analysis plugin for x-ray.
Install
pip install mongo-x-ray mongo-x-ray-log
Usage
x-ray log /var/log/mongodb/mongod.log
x-ray log /var/log/mongodb/ 2026-07-20T08:00:00Z 2026-07-20T10:00:00Z
x-ray log /path/to/mongod.log -f html -o /path/to/output/
# Analyze a random 10% of a large log
x-ray log -r 0.1 mongodb.log
# Discover log folders recursively
x-ray log --discover /var/log/
Compatibility
Supports MongoDB 5.0 and above on all topologies:
| Replica Set | Sharded Cluster | Standalone |
|---|---|---|
| ✅ | ✅ | ✅ |
Parameters
x-ray log [-h] [-s CHECKSET] [-o OUTPUT] [-f {markdown,html,pdf}] [--no-browser]
[-r RATE] [--top TOP] [--discover] log_file [start_time] [end_time]
| Argument | Description | Default |
|---|---|---|
log_file |
Path to the MongoDB log file, or a folder of log files to analyze. | required |
start_time |
Inclusive UTC start time in ISO-8601 format. | first log line |
end_time |
Inclusive UTC end time in ISO-8601 format. | last log line |
-s, --checkset |
Checkset to run. | default |
-o, --output |
Output folder path. | output/ |
-f, --format |
Output format: markdown, html or pdf (PDF also keeps Markdown and HTML). |
html |
--no-browser |
Do not open the generated report in the browser. | false |
-r, --rate |
Log sampling rate, e.g. 1 for all logs, 0.1 for 10% of logs. |
1 |
--top |
Top N slow queries to list. | 10 |
--discover |
Recursively search the given path for folders containing log files. | false |
Analysis Items
| Item | Purpose |
|---|---|
InfoItem |
Basic information about the MongoDB instance. |
ClientMetaItem |
Visualize client metadata (application, driver, OS, client IPs). |
ConnectionRateItem |
Analyze the rate of connections created and ended over a time window. |
LogRateItem |
Show the rate at which different log messages (grouped by log ID) appear over time. |
SlowItem |
Identify the top N slowest operations (table with sample viewers) and chart them over time as tabs (duration / scanned / scanned objects). |
SlowRateItem |
Analyze the rate of slow queries. |
StateTraceItem |
Visualize replica set member state changes over time. |
WEFItem |
Visualize warning, error and fatal log messages. |
Development
Requires Python 3.10+, MongoDB 5.0 or later, and the mongo-x-ray core package.
make unit-test # run the unit tests
make lint # ruff check + ruff format --check
make minify # minify templates
Metadata
Release files for mongo-x-ray-log 2.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mongo_x_ray_log-2.1.2.tar.gz | 63.9 kB | With provenance | Details for mongo_x_ray_log-2.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mongo_x_ray_log-2.1.2-py3-none-any.whl | Python 3 | none | any | Details for mongo_x_ray_log-2.1.2-py3-none-any.whl |
Total release size: 150.3 kB
Release files / mongo_x_ray_log-2.1.2.tar.gz
| Download URL | mongo_x_ray_log-2.1.2.tar.gz |
|---|---|
| Size | 63.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ff03460f857dea98a23e5d93c2dab2cb5a3647347ecfba3b2a472eda94b8d11f
|
|
BLAKE2b-256 checksum How to use checksums |
596c4fcdd8c263f1ac5d91277dfa02ccad643225b0d2161c13740965079a664f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.
Transparency logRelease files / mongo_x_ray_log-2.1.2-py3-none-any.whl
| Download URL | mongo_x_ray_log-2.1.2-py3-none-any.whl |
|---|---|
| Size | 86.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a5e6577b4829853775af648fd2982e8a577f96237d87210e249cdba03595a948
|
|
BLAKE2b-256 checksum How to use checksums |
8976037ccfda957da6ae7500b4332a9d82c0d3f4d5b45ab3238554d046c08d5f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.
Transparency logSecurity for mongo-x-ray-log 2.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for mongo_x_ray_log-2.1.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.