mrsarm / mongotail Goto Github PK
View Code? Open in Web Editor NEWCommand line tool to log all MongoDB queries in a "tail"able way
Home Page: https://pypi.org/project/mongotail/
License: GNU General Public License v3.0
Command line tool to log all MongoDB queries in a "tail"able way
Home Page: https://pypi.org/project/mongotail/
License: GNU General Public License v3.0
For example if you pipe with grep
, this is the output when you abort the operation with Ctrl+C.
$ mongotail test -f | grep QUERY
^Cclose failed in file object destructor:
sys.excepthook is missing
lost sys.stderr
This is a great tool. Unfortunately I'm trying to inspect my sort criteria, but it's not being displayed alongside the query.
Could I request to display the sort criteria too?
Thanks for this!
It would be great to add support for tailing the oplog as an alternative to using system profile data.
For a deployment with the oplog enabled (i.e. a replica set, although this can be enabled on a standalone node):
I have setted mongodb profile level 2. then , insert/update can show normally
Quote from deprecation notes in the version 3.12.0 of PyMongo:
Deprecated support for database profiler helpers profiling_level(), set_profiling_level(), and profiling_info(). Instead, users should run the profile command with the command() helper directly.
Another option used in Mongotail that is deprecated:
Deprecated the
ssl_keyfile
andssl_certfile
URI options in favor oftlsCertificateKeyFile
(see TLS/SSL and PyMongo).
I get around 150% CPU running the docker image on Mac with level 2 logging. I think it worked better the other day so maybe something that comes after a while. Hard to debug for meβ¦ Will try to use the python version natively instead nowβ¦
Hello @mrsarm!
Looks like mongotail does not support bytes
(i.e. binary data) coming from MongoDB. Please consider the following details regarding found bug:
(venv) resurtm@resurtm-desktop:~/dev/mongotail$ mongotail task_tracker -f
2017-11-27 18:34:41.777 COUNT [users] : {"$or": [{"username": "resurtm"}, {"email": "[email protected]"}]}
Traceback (most recent call last):
File "/home/resurtm/dev/mongotail/venv/lib/python3.5/site-packages/mongotail/out.py", line 60, in print_obj
query += ', ' + json_encoder.encode(obj['updateobj'])
File "/home/resurtm/dev/mongotail/venv/lib/python3.5/site-packages/mongotail/jsondec.py", line 57, in encode
result = super(JSONEncoder, self).encode(o)
File "/usr/lib/python3.5/json/encoder.py", line 198, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib/python3.5/json/encoder.py", line 256, in iterencode
return _iterencode(o, 0)
File "/home/resurtm/dev/mongotail/venv/lib/python3.5/site-packages/mongotail/jsondec.py", line 54, in default
return json.JSONEncoder.default(self, o)
File "/usr/lib/python3.5/json/encoder.py", line 179, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: b'$2b$12$d3Kr8DL2nvhCyzvbgUTbROhCS.RqUO0R/wmw7DdXbhvOgqk5Ql2vC' is not JSON serializable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/resurtm/dev/mongotail/venv/bin/mongotail", line 11, in <module>
sys.exit(main())
File "/home/resurtm/dev/mongotail/venv/lib/python3.5/site-packages/mongotail/mongotail.py", line 237, in main
tail(client, db, args.n, args.follow, args.verbose, args.metadata)
File "/home/resurtm/dev/mongotail/venv/lib/python3.5/site-packages/mongotail/mongotail.py", line 83, in tail
print_obj(result, verbose, metadata, server_version)
File "/home/resurtm/dev/mongotail/venv/lib/python3.5/site-packages/mongotail/out.py", line 168, in print_obj
warn('Unknown registry\nDump: %s' % json_encoder.encode(obj))
File "/home/resurtm/dev/mongotail/venv/lib/python3.5/site-packages/mongotail/jsondec.py", line 57, in encode
result = super(JSONEncoder, self).encode(o)
File "/usr/lib/python3.5/json/encoder.py", line 198, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib/python3.5/json/encoder.py", line 256, in iterencode
return _iterencode(o, 0)
File "/home/resurtm/dev/mongotail/venv/lib/python3.5/site-packages/mongotail/jsondec.py", line 54, in default
return json.JSONEncoder.default(self, o)
File "/usr/lib/python3.5/json/encoder.py", line 179, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: b'$2b$12$d3Kr8DL2nvhCyzvbgUTbROhCS.RqUO0R/wmw7DdXbhvOgqk5Ql2vC' is not JSON serializable
(venv) resurtm@resurtm-desktop:~/dev/mongotail$
Data in MongoDB:
{
"_id" : ObjectId("5a1bf2658a23bfeed32e7dde"),
"first_name" : "Timur",
"username" : "resurtm",
"email" : "[email protected]",
"password" : { "$binary" : "JDJiJDEyJGZnZ0QzdkRoVVRlRVhvMmdqQUNIeE9scEhSZHk5bGpXL01IOFRXUVhCdjN0RWs4QzlJaFRL", "$type" : "00" },
"last_name" : "Ruziev"
}
Let me know if you need more details or I'm missing something.
Thank you for such a nice project as mongotail! π
Cheers,
@resurtm
We use mongo with the c# driver and store the UUID's in .net format GUID.
I installed mongotail on ubuntu 14 LTS and ran the command to set the profile level with no issues. Starting mongo tail instantly blew up with this error though.
Traceback (most recent call last):
File "/usr/local/bin/mongotail", line 9, in <module>
load_entry_point('mongotail==1.0.1', 'console_scripts', 'mongotail')()
File "/usr/local/lib/python2.7/dist-packages/mongotail/mongotail.py", line 159, in main
tail(client, db, args.n, args.follow)
File "/usr/local/lib/python2.7/dist-packages/mongotail/mongotail.py", line 68, in tail
print_obj(result)
File "/usr/local/lib/python2.7/dist-packages/mongotail/out.py", line 42, in print_obj
query = json_encoder.encode(obj['query'])
File "/usr/local/lib/python2.7/dist-packages/mongotail/jsondec.py", line 45, in encode
result = super(JSONEncoder, self).encode(o)
File "/usr/lib/python2.7/json/encoder.py", line 207, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib/python2.7/json/encoder.py", line 270, in iterencode
return _iterencode(o, 0)
File "/usr/local/lib/python2.7/dist-packages/mongotail/jsondec.py", line 42, in default
return json.JSONEncoder.default(self, o)
File "/usr/lib/python2.7/json/encoder.py", line 184, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: UUID('3ef7273b-cc4d-4b11-9237-d766c18db028') is not JSON serializable
The encoder doesn't seem to like UUIDs π’
Listing indexes from a collection with this: db.foo.getIndexKeys()
, Mongotail gets this:
Mongotail EXCEPTION - Unknown command operation
Dump: {"ns": "test.foo", "command": {"listIndexes": "foo"}, "ts": ISODate("2016-09-29T12:39:39.280Z"), "op": "command"}
Mongotail EXCEPTION - Unknown registry
Dump: {"ns": "test.foo", "command": {"listIndexes": "foo"}, "ts": ISODate("2016-09-29T12:39:39.280Z"), "op": "command"}
MaxKey
looks problematicdb.users.find({value: new MaxKey()})
This will break the
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/mongotail/out.py", line 57, in print_obj
query = json_encoder.encode(cmd['filter']) if 'filter' in cmd else "{}"
File "/usr/local/lib/python3.8/site-packages/mongotail/jsondec.py", line 63, in encode
result = super(JSONEncoder, self).encode(o)
File "/usr/local/lib/python3.8/json/encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/local/lib/python3.8/json/encoder.py", line 257, in iterencode
return _iterencode(o, 0)
File "/usr/local/lib/python3.8/site-packages/mongotail/jsondec.py", line 60, in default
return json.JSONEncoder.default(self, o)
File "/usr/local/lib/python3.8/json/encoder.py", line 179, in default
raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type MaxKey is not JSON serializable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/mongotail", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.8/site-packages/mongotail/mongotail.py", line 239, in main
tail(client, db, args.n, args.follow, args.verbose, args.metadata)
File "/usr/local/lib/python3.8/site-packages/mongotail/mongotail.py", line 83, in tail
print_obj(result, verbose, metadata, server_version)
File "/usr/local/lib/python3.8/site-packages/mongotail/out.py", line 200, in print_obj
warn('Unknown registry\nDump: %s' % json_encoder.encode(obj))
File "/usr/local/lib/python3.8/site-packages/mongotail/jsondec.py", line 63, in encode
result = super(JSONEncoder, self).encode(o)
File "/usr/local/lib/python3.8/json/encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/local/lib/python3.8/json/encoder.py", line 257, in iterencode
return _iterencode(o, 0)
File "/usr/local/lib/python3.8/site-packages/mongotail/jsondec.py", line 60, in default
return json.JSONEncoder.default(self, o)
File "/usr/local/lib/python3.8/json/encoder.py", line 179, in default
raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type MaxKey is not JSON serializable
Note I did not tried with all 20+ Mongodb types https://docs.mongodb.com/manual/reference/operator/query/type/
res-address 2.0.0:
def get_res_address(address): """ <REDACTED> :return: a tuple with ``(scheme, host, port, resource, query, username, password)``. <REDACTED> """
mongotail 3.0.0:
def connect(address, args):
...
try:
host, port, dbname = get_res_address(address)
it appears issue started in commit 1ef2c825984050ad5d296d9be55831f312fb625f of the res-address project, in which get_res_address began returning more than 3 values
Is there special configuration required to get queries to log? I don't ever see any QUERY entries in the log, which is what I'm most interested in looking at. I can only see inserts and drops (the setup of my test case, but not my test case).
$ mongotail myserver/mydb -l 2
Profiling level set to level 2
$ mongotail myserver/mydb -f
2021-01-06 23:53:08.418 DROP [mycoll] :
2021-01-06 23:53:08.559 INSERT [mycoll] : 1 inserted.
2021-01-06 23:53:08.624 INSERT [mycoll] : 1 inserted.
I'm using a Mongo 4.4.2 standalone server on Linux.
If a log entry is written where a MongoDB timestamp is included, the logger fails with an exception:
Traceback (most recent call last):
File "/usr/local/bin/mongotail", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/site-packages/mongotail/mongotail.py", line 238, in main
tail(client, db, args.n, args.follow, args.verbose, args.metadata)
File "/usr/local/lib/python2.7/site-packages/mongotail/mongotail.py", line 83, in tail
print_obj(result, verbose, metadata, server_version)
File "/usr/local/lib/python2.7/site-packages/mongotail/out.py", line 196, in print_obj
warn('Unknown registry\nDump: %s' % json_encoder.encode(obj))
File "/usr/local/lib/python2.7/site-packages/mongotail/jsondec.py", line 60, in encode
result = super(JSONEncoder, self).encode(o)
File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 207, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 270, in iterencode
return _iterencode(o, 0)
File "/usr/local/lib/python2.7/site-packages/mongotail/jsondec.py", line 57, in default
return json.JSONEncoder.default(self, o)
File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 184, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: Timestamp(1548943026, 1) is not JSON serializable
I'm using:
mongotail --version
mongotail 2.2.0 <https://github.com/mrsarm/mongotail> (python 2.7.15)
docker run -it --rm mrsarm/mongotail 192.168.0.227/portal,
Error parsing command line: Invalid database "portal,"
I have databased named portal,
.
Discovered via the nodeJS mongo native driver issuing findOneAndDelete()
commands where the 'command' was cased as findAndModify
, instead of the findandmodify
currently expected by the text matching in mongotail.
Additional testing showed that it is possible to generate a similar failure with Map-Reduce commands as Mongo similarly will honor casing of 'mapreduce' or 'mapReduce' as the command.
> db.test.findOneAndDelete({"somefield": 1});
OR
> db.runCommand({"findandmodify": "test", "query": {"somefield": 1 }, "remove": true,"new": false,"upsert": false});
> db.runCommand({"findAndModify": "test", "query": {"somefield": 1 }, "remove": true,"new": false,"upsert": false});
mongotail output:
Mongotail EXCEPTION - Unknown command operation
Dump: {"op": "command", "ns": "calypso.test", "command": {"findAndModify": "test", "query": {"somefield": 1.0}, "remove": true, "new": false, "upsert": false, "lsid": {"id": BinData(0,"ASV1ww3RQ3ebaPD8AlXihA==")}, "$db": "calypso"}, "ndeleted": 0, "ts": ISODate("2023-04-01T22:06:59.223Z")}
Mongotail EXCEPTION - Unknown registry
Dump: {"op": "command", "ns": "calypso.test", "command": {"findAndModify": "test", "query": {"somefield": 1.0}, "remove": true, "new": false, "upsert": false, "lsid": {"id": BinData(0,"ASV1ww3RQ3ebaPD8AlXihA==")}, "$db": "calypso"}, "ndeleted": 0, "ts": ISODate("2023-04-01T22:06:59.223Z")}
> db.orders.mapReduce( mapFunction1, reduceFunction1, { out: "map_reduce_example" } )
OR
> db.runCommand({"mapreduce": "orders", map: mapFunction1, reduce: reduceFunction1, out: "map_reduce_example"});
> db.runCommand({"mapReduce": "orders", map: mapFunction1, reduce: reduceFunction1, out: "map_reduce_example"});
mongotail output:
Mongotail EXCEPTION - Unknown registry
Dump: {"op": "command", "ns": "calypso.orders", "command": {"mapReduce": "orders", "map": "function() {\n emit(this.cust_id, this.price);\n}", "reduce": "function(keyCustId, valuesPrices) {\n return Array.sum(valuesPrices);\n}", "out": "map_reduce_example", "lsid": {"id": BinData(0,"CNpTo5aTR6eohBp38syUxg==")}, "$db": "calypso"}, "ts": ISODate("2023-04-02T00:54:21.137Z")}
I installed the tool and am running mongotail [db] --follow
. I expect that the command will block until I kill it with ctrl+c
. Instead, it exits after 1 second, without printing anything.
It would be good if it warned that you needed to run with --level=2
, if --level=2
was the default mode, or otherwise displayed a warning or error, instead of exiting without displaying any messages.
OSX. MongoDB server version: 4.0.1
mongotail 2.2.0 https://github.com/mrsarm/mongotail (python 2.7.15)
$ mongotail localhost/mydb --level 2 -f
Profiling level set to level 2
then exits back to shell.
I should say that:
$ mongotail localhost/mydb -f
works fine, except doesn't show all the queries.
And/or other metadata
MongoDB shell version v4.1.13
git version: 441714bc4c70699950f3ac51a5cac41dcd413eaa
OpenSSL version: OpenSSL 1.1.1 11 Sep 2018
allocator: tcmalloc
modules: none
build environment:
distmod: ubuntu1804
distarch: x86_64
target_arch: x86_64
I carried out the order
docker run -it --rm fgribreau/mongotail ip:27017/db -uroot -p123456123 -f
When I execute query
Mongotail EXCEPTION - Unknown registry
Dump: {"op": "query", "ns": "merchant.platform", "command": {"limit": 1, "skip": 0, "find": "platform", "$db": "db", "filter": {"_id": ObjectId("5e884cde0c708488b0ddf486")}, "singleBatch": true, "batchSize": 1}, "nreturned": 1, "ts": ISODate("2020-04-06T12:11:19.450Z")}
help me
when i execute mongotail - f show this:
Mongotail EXCEPTION - Unknown registry
Dump: {"ns": "usersSantander.usersSantander", "command": {"filter": {"username": "uid1"}, "$db": "usersSantander", "lsid": {"id": UUID("f9b97a39-221c-45dc-9532-e3165186c53b")}, "find": "usersSantander"}, "ts": ISODate("2018-01-22T20:43:06.721Z"), "nreturned": 1, "op": "query"}
Mongotail EXCEPTION - Unknown registry
Dump: {"ns": "usersSantander.usersSantander", "command": {"filter": {"username": "uid2"}, "$db": "usersSantander", "lsid": {"id": UUID("f9b97a39-221c-45dc-9532-e3165186c53b")}, "find": "usersSantander"}, "ts": ISODate("2018-01-22T20:56:20.817Z"), "nreturned": 1, "op": "query"}
Mongotail EXCEPTION - Unknown registry
Dump: {"ns": "usersSantander.usersSantander", "command": {"filter": {"username": "uid3"}, "$db": "usersSantander", "lsid": {"id": UUID("f9b97a39-221c-45dc-9532-e3165186c53b")}, "find": "usersSantander"}, "ts": ISODate("2018-01-22T21:01:32.228Z"), "nreturned": 1, "op": "query"}
Mongotail EXCEPTION - Unknown registry
Dump: {"ns": "usersSantander.usersSantander", "command": {"filter": {"username": "uid4"}, "$db": "usersSantander", "lsid": {"id": UUID("f9b97a39-221c-45dc-9532-e3165186c53b")}, "find": "usersSantander"}, "ts": ISODate("2018-01-22T21:02:57.218Z"), "nreturned": 0, "op": "query"}
in centos 7
When i try to connect mongo tail, explode some erros:
PS: One field is a binary value
Traceback (most recent call last): File "/usr/local/bin/mongotail", line 11, in <module> load_entry_point('mongotail==2.2.0', 'console_scripts', 'mongotail')() File "/usr/local/lib/python2.7/site-packages/mongotail-2.2.0-py2.7.egg/mongotail/mongotail.py", line 238, in main tail(client, db, args.n, args.follow, args.verbose, args.metadata) File "/usr/local/lib/python2.7/site-packages/mongotail-2.2.0-py2.7.egg/mongotail/mongotail.py", line 83, in tail print_obj(result, verbose, metadata, server_version) File "/usr/local/lib/python2.7/site-packages/mongotail-2.2.0-py2.7.egg/mongotail/out.py", line 65, in print_obj query += ', ' + json_encoder.encode(obj['updateobj']) File "/usr/local/lib/python2.7/site-packages/mongotail-2.2.0-py2.7.egg/mongotail/jsondec.py", line 60, in encode result = super(JSONEncoder, self).encode(o) File "/usr/local/Cellar/python@2/2.7.14_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 207, in encode chunks = self.iterencode(o, _one_shot=True) File "/usr/local/Cellar/python@2/2.7.14_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 270, in iterencode return _iterencode(o, 0) UnicodeDecodeError: 'utf8' codec can't decode byte 0x80 in position 0: invalid start byte
When I run Mongotail (which is very helpful, BTW!), sometimes I get lines like this:
Mongotail EXCEPTION - Unknown command operation
Dump: {"ns": "dbname.$cmd", "command": {"createIndexes": "collectionname", "indexes": [{"key": {"fieldname": 1}, "unique": true, "sparse": false, "background": false, "name": "fieldname_1"}]}, "ts": ISODate("2015-09-21T20:47:21.719Z"), "op": "command"}
Mongotail EXCEPTION - Unknown registry
Dump: {"ns": "dbname.$cmd", "command": {"createIndexes": "collectionname", "indexes": [{"key": {"fieldname": 1}, "unique": true, "sparse": false, "background": false, "name": "fieldname_1"}]}, "ts": ISODate("2015-09-21T20:47:21.719Z"), "op": "command"}
I think they're from my framework ensuring that the proper indexes exist in my Mongo database.
Looking at issue #5, I suspect this might be as simple as adding a new entry for operation "createIndexes" in out.py, but I haven't tried it yet.
Executing a $lookup
operation with the $out
operator like this:
db.orders.aggregate([
{
$lookup: {
from: "products",
localField: "item",
foreignField: "_id",
as: "products"
}
},
{ $out: "orders_report" }
]);
Mongotail gets this:
Mongotail EXCEPTION - Unknown command operation
Dump: {"ns": "orders.tmp.agg_out.12", "command": {"create": "tmp.agg_out.12", "temp": true}, "ts": ISODate("2016-09-28T14:25:45.733Z"), "op": "command"}
Mongotail EXCEPTION - Unknown registry
Dump: {"ns": "orders.tmp.agg_out.12", "command": {"create": "tmp.agg_out.12", "temp": true}, "ts": ISODate("2016-09-28T14:25:45.733Z"), "op": "command"}
Mongotail EXCEPTION - Unknown command operation
Dump: {"ns": "orders.orders_report", "command": {"cursor": {}, "listIndexes": "orders_report"}, "ts": ISODate("2016-09-28T14:25:45.733Z"), "op": "command"}
Mongotail EXCEPTION - Unknown registry
Dump: {"ns": "orders.orders_report", "command": {"cursor": {}, "listIndexes": "orders_report"}, "ts": ISODate("2016-09-28T14:25:45.733Z"), "op": "command"}
2016-09-28 14:25:45.734 QUERY [products] : {"_id": {"$eq": ObjectId("57ebc2c6ef7c92105f8cb036")}}. 1 returned.
2016-09-28 14:25:45.734 QUERY [products] : {"_id": {"$eq": ObjectId("57ebc2c6ef7c92105f8cb036")}}. 1 returned.
2016-09-28 14:25:45.734 QUERY [products] : {"_id": {"$eq": ObjectId("57ebc2c7ef7c92105f8cb037")}}. 1 returned.
2016-09-28 14:25:45.734 QUERY [products] : {"_id": {"$eq": ObjectId("57ebc2c7ef7c92105f8cb037")}}. 1 returned.
2016-09-28 14:25:45.735 QUERY [products] : {"_id": {"$eq": ObjectId("57ebc2c7ef7c92105f8cb037")}}. 1 returned.
2016-09-28 14:25:45.735 QUERY [products] : {"_id": {"$eq": ObjectId("57ebc2c7ef7c92105f8cb039")}}. 1 returned.
Mongotail EXCEPTION - Unknown registry
Dump: {"ns": "orders.tmp.agg_out.12", "ninserted": 6, "ts": ISODate("2016-09-28T14:25:45.735Z"), "op": "insert"}
Mongotail EXCEPTION - Unknown command operation
Dump: {"ns": "orders.tmp.agg_out.12", "command": {"to": "orders.orders_report", "dropTarget": true, "renameCollection": "orders.tmp.agg_out.12"}, "ts": ISODate("2016-09-28T14:25:45.739Z"), "op": "command"}
Mongotail EXCEPTION - Unknown registry
Dump: {"ns": "orders.tmp.agg_out.12", "command": {"to": "orders.orders_report", "dropTarget": true, "renameCollection": "orders.tmp.agg_out.12"}, "ts": ISODate("2016-09-28T14:25:45.739Z"), "op": "command"}
2016-09-28 14:25:45.739 AGGREGATE [orders] : [{"$lookup": {"foreignField": "_id", "as": "products", "from": "products", "localField": "item"}}, {"$out": "orders_report"}]
Mongotail by default authenticates against the database specified in the db address. But MongoDB allows too to authenticate against a different database, e.g. via the --authenticationDatabase
option in
the mongo shell client.
It would be great that mongotail allowed to authenticate against a different database than the specified in the db address.
The error happens when you expand at first time the collections of a database with MongoChef. Tested with Mongotail 2.0.0, MongoChef 3.5.1, and MongoDB versions 2.6 and 3.2.
$ mongotail test -f
Mongotail EXCEPTION - Unknown command operation
Dump: {"ns": "test.$cmd", "command": {"scale": 1, "dbStats": 1}, "ts": ISODate("2016-08-10T10:39:57.572Z"), "op": "command"}
Hi,
I'd love to use the tool, but I can't connect to the mongodb atlas instance:
docker run -it --rm mrsarm/mongotail 'mongodb+srv://somename-pl-0.foo.mongodb.net/bar-service' -u mytmpuser -b admin
Error parsing command line: Invalid address "mongodb+srv://somename-pl-0.foo.mongodb.net/bar-service"
try 'mongotail --help' for more information
How can I fix the connection or get a proper error message?
This also happens with pip installed version on Mac.
BR
Alex
Hello,
I installed mongotail
and run it like:
mongotail myDbName
but nothing happens, the program just closes after less than a second. It's a local db, it has no password or anything. I don't know if mongotail logs anything, I did a quick search and found no logs.
2015-07-26 11:06:07.347 QUERY [person] : {"type": {"$in": [2]}, "short_id": "3000000"}
2015-07-26 11:06:07.347 QUERY [tag] : {}
2015-07-26 11:06:07.349 QUERY [category] : {}
2015-07-26 11:06:07.351 QUERY [size_chart] : {"deviser_id": "3000000", "type": 1}
2015-07-26 11:06:07.366 QUERY [category] : {"$orderby": {"name.en-US": 1}, "$query": {"path": "/"}}
2015-07-26 11:06:08.799 QUERY [size_chart] : {"type": 0, "categories": {"$in": ["fb3d0"]}}
2015-07-26 11:26:50.240 QUERY [category] : {}
Mongotail EXCEPTION - Unknown operation "killcursors"
Dump: {"ns": "", "ts": ISODate("2015-07-26T11:26:50.240Z"), "op": "killcursors"}
Traceback (most recent call last):
File "/usr/local/bin/mongotail", line 9, in <module>
load_entry_point('mongotail==0.3.2', 'console_scripts', 'mongotail')()
File "/usr/local/lib/python2.7/dist-packages/mongotail/mongotail.py", line 156, in main
tail(client, db, args.n, args.follow)
File "/usr/local/lib/python2.7/dist-packages/mongotail/mongotail.py", line 68, in tail
print_obj(result)
File "/usr/local/lib/python2.7/dist-packages/mongotail/out.py", line 129, in print_obj
operation.upper().ljust(9), doc, query))
UnboundLocalError: local variable 'query' referenced before assignment
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.