Skip to content

Commit e6d6e50

Browse files
ajhuh-mdbjeff-allen-mongo
authored andcommitted
DOCS-14022 specify whether client IP is added to slow query log lines
1 parent 155daa0 commit e6d6e50

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

source/reference/log-messages.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -851,13 +851,17 @@ object associated with the operation.
851851

852852
.. include:: /includes/extracts/4.2-changes-log-query-shapes-plan-cache-key.rst
853853

854+
Starting in MongoDB 5.0, :ref:`slow operation
855+
<database-profiling-specify-slowms-threshold>` log messages include a
856+
``remote`` field specifying client IP address.
857+
854858
The following example output includes information about
855859
a slow :doc:`aggregation </aggregation>` operation:
856860

857861
.. code-block:: javascript
858862
:copyable: false
859863

860-
{"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}}
864+
{"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}}
861865

862866
See the :ref:`examples section <log-message-json-examples>` for a
863867
:ref:`pretty-printed <log-message-pretty-printing>` version of this log
@@ -1264,6 +1268,7 @@ This example shows a :ref:`slow operation message
12641268
"cache": 849
12651269
}
12661270
},
1271+
"remote": "192.168.14.15:37666",
12671272
"protocol": "op_msg",
12681273
"durationMillis": 22427
12691274
}

source/release-notes/5.0.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,13 @@ Log Changes to Database Profiler Settings
405405

406406
.. include:: /includes/log-changes-to-database-profiler.rst
407407

408+
``remote`` Field in Slow Operation Logs
409+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
410+
411+
Starting in MongoDB 5.0, :ref:`slow operation
412+
<database-profiling-specify-slowms-threshold>` log messages include a
413+
``remote`` field specifying client IP address.
414+
408415
Define Variables Using the ``let`` Option
409416
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
410417

0 commit comments

Comments
 (0)