diff --git a/source/reference/log-messages.txt b/source/reference/log-messages.txt index ea9826d0c4c..fb1f952923f 100644 --- a/source/reference/log-messages.txt +++ b/source/reference/log-messages.txt @@ -851,13 +851,17 @@ object associated with the operation. .. include:: /includes/extracts/4.2-changes-log-query-shapes-plan-cache-key.rst +Starting in MongoDB 5.0, :ref:`slow operation +` log messages include a +``remote`` field specifying client IP address. + The following example output includes information about a slow :doc:`aggregation ` operation: .. code-block:: javascript :copyable: false - {"t":{"$date":"2020-05-20T20:10:08.731+00:00"},"s":"I", "c":"COMMAND", "id":51803, "ctx":"conn281","msg":"Slow query","attr":{"type":"command","ns":"stocks.trades","appName":"MongoDB Shell","command":{"aggregate":"trades","pipeline":[{"$project":{"ticker":1.0,"price":1.0,"priceGTE110":{"$gte":["$price",110.0]},"_id":0.0}},{"$sort":{"price":-1.0}}],"allowDiskUse":true,"cursor":{},"lsid":{"id":{"$uuid":"fa658f9e-9cd6-42d4-b1c8-c9160fabf2a2"}},"$clusterTime":{"clusterTime":{"$timestamp":{"t":1590005405,"i":1}},"signature":{"hash":{"$binary":{"base64":"AAAAAAAAAAAAAAAAAAAAAAAAAAA=","subType":"0"}},"keyId":0}},"$db":"test"},"planSummary":"COLLSCAN","cursorid":1912190691485054730,"keysExamined":0,"docsExamined":1000001,"hasSortStage":true,"usedDisk":true,"numYields":1002,"nreturned":101,"reslen":17738,"locks":{"ReplicationStateTransition":{"acquireCount":{"w":1119}},"Global":{"acquireCount":{"r":1119}},"Database":{"acquireCount":{"r":1119}},"Collection":{"acquireCount":{"r":1119}},"Mutex":{"acquireCount":{"r":117}}},"storage":{"data":{"bytesRead":232899899,"timeReadingMicros":186017},"timeWaitingMicros":{"cache":849}},"protocol":"op_msg","durationMillis":22427}} + {"t":{"$date":"2020-05-20T20:10:08.731+00:00"},"s":"I", "c":"COMMAND", "id":51803, "ctx":"conn281","msg":"Slow query","attr":{"type":"command","ns":"stocks.trades","appName":"MongoDB Shell","command":{"aggregate":"trades","pipeline":[{"$project":{"ticker":1.0,"price":1.0,"priceGTE110":{"$gte":["$price",110.0]},"_id":0.0}},{"$sort":{"price":-1.0}}],"allowDiskUse":true,"cursor":{},"lsid":{"id":{"$uuid":"fa658f9e-9cd6-42d4-b1c8-c9160fabf2a2"}},"$clusterTime":{"clusterTime":{"$timestamp":{"t":1590005405,"i":1}},"signature":{"hash":{"$binary":{"base64":"AAAAAAAAAAAAAAAAAAAAAAAAAAA=","subType":"0"}},"keyId":0}},"$db":"test"},"planSummary":"COLLSCAN","cursorid":1912190691485054730,"keysExamined":0,"docsExamined":1000001,"hasSortStage":true,"usedDisk":true,"numYields":1002,"nreturned":101,"reslen":17738,"locks":{"ReplicationStateTransition":{"acquireCount":{"w":1119}},"Global":{"acquireCount":{"r":1119}},"Database":{"acquireCount":{"r":1119}},"Collection":{"acquireCount":{"r":1119}},"Mutex":{"acquireCount":{"r":117}}},"storage":{"data":{"bytesRead":232899899,"timeReadingMicros":186017},"timeWaitingMicros":{"cache":849}},"remote": "192.168.14.15:37666","protocol":"op_msg","durationMillis":22427}} See the :ref:`examples section ` for a :ref:`pretty-printed ` version of this log @@ -1264,6 +1268,7 @@ This example shows a :ref:`slow operation message "cache": 849 } }, + "remote": "192.168.14.15:37666", "protocol": "op_msg", "durationMillis": 22427 } diff --git a/source/release-notes/5.0.txt b/source/release-notes/5.0.txt index 862d4cba278..5b1596e6916 100644 --- a/source/release-notes/5.0.txt +++ b/source/release-notes/5.0.txt @@ -405,6 +405,13 @@ Log Changes to Database Profiler Settings .. include:: /includes/log-changes-to-database-profiler.rst +``remote`` Field in Slow Operation Logs +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Starting in MongoDB 5.0, :ref:`slow operation +` log messages include a +``remote`` field specifying client IP address. + Define Variables Using the ``let`` Option ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~