Customized mongodb's mtools (query tool)
Needs python 2.7
virtualenv venv
source venv/bin/activate
pip install -r requirements.freeze.txt
- grouping by collection (useful for multitenant implemented by separate dbs)
- limit to top 30 elements
- sorting by total time
- [TODO] connects to db, displays hints on existing indexes
./mloginfo2.py /var/log/mongod.log --queries2
To execute only on log after "DateTime":
a. Find the first "DateTime" line number in the mongodb log
b. Copy the contents after that line in another file:
tail -n +LineNumber /var/log/mongod.log > /var/log/mongod_latest.log