-
Notifications
You must be signed in to change notification settings - Fork 403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for reading structured logs (aka logv2) from MongoDB 4.4+ #806
Comments
Hi, Thanks for this amazing tools. Best regards, |
@nanangarsyad-mt I'm not aware of a trivial conversion of JSON logs to the legacy log format, but that's the general scope of this improvement suggestion. Since MongoDB 4.4+ logs are in JSON format you can likely work out conversion using a JSON library or tool like If you do work out an approach, please comment here with more info. I also suggest having a look at the Keyhole project, which aims to provide more actionable insights than mtools including performance analytics, tuning, and monitoring. Keyhole supports legacy MongoDB log formats, 4.4+ structured logs, and also the compressed FTDC (Full Time Diagnostic data Capture) diagnostic data from MongoDB 3.2+. There's a good series of blog posts with more info from Keyhole's creator: Peek at your MongoDB Clusters like a Pro with Keyhole Part 1, Part 2, and Part 3. |
I am using MongoDB on an ATLAS cluster and was pretty surprised mtools cannot handle its default log format. I guess the issue is about addressing this? |
I am using Mongodb atlas, tried to convert the log files to old format it did but m tools unable to read it! sed -E 's/^{"t":{"$date":"|"},"s":"|",[ ]{0,9}"c":"|",[ ]{0,9}"id":|,[ ]{0,9}"ctx":"|","msg":|}$/ /g' yourMongod4_4.log > mongodb.log |
Did we get any fix on this ? |
Having used keyhole, I can say that it attempts to be much more than what the log analysis part of mtools did, but without the features many like about mtools, including plotting queries and getting list of query shapes. The point is, that keyhole's target consumer appears to be someone like Ken, a MongoDB consultant, and not directly to someone like us, customers using MongoDB. Additionally, having read through the three blog post, keyhole's features does not include log analysis. |
@SteveH-US, the keyhole log analytics blog is first available in the Peek at your MongoDB Clusters like a Pro with Keyhole Part 1. Additional blogs about the feature can be found at Feel The Pulse of Mongo and Streamline Keyhole and Maobi Reports Creation. Keyhole prints out a summary, but to get a better analytics report, use it with Maobi. The latest Moabi also plots ops in a chart. |
Hi Ken, Having read through the three blog post, keyhole's features does not include log analysis. |
hope to support |
@SteveH-US , I created Hatchet for JSON log processing, and it includes an audit page to report exceptions and usages as well as other reports and charts. A blog is also available. Ideas and suggestions are welcome. |
Any updates on this? Why not just hack it and use convert-json-logs-legacy as a dependency to handle the conversion |
It took me a little while to figure out why I got the error:
The first line in the file I have now successfully parsed the converted content of a Mongo JSON file, with |
I've tried to use
|
Starting in the MongoDB 4.4 release,
mongod
andmongos
output all log messages in a new structured JSON format which is designed to be parseable using standard JSON libraries. JSON tools such asjq
andmongoimport
can also be used.The text was updated successfully, but these errors were encountered: