diff options
-rw-r--r-- | jstests/auth/logs_include_client_info.js | 4 | ||||
-rw-r--r-- | jstests/ssl/x509_client.js | 2 | ||||
-rw-r--r-- | src/mongo/db/auth/sasl_commands.cpp | 4 | ||||
-rw-r--r-- | src/mongo/db/commands/authentication_commands.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/curop.cpp | 4 | ||||
-rw-r--r-- | src/mongo/transport/transport_layer_asio_test.cpp | 8 |
6 files changed, 12 insertions, 12 deletions
diff --git a/jstests/auth/logs_include_client_info.js b/jstests/auth/logs_include_client_info.js index 17a4fec461b..efd8bf51282 100644 --- a/jstests/auth/logs_include_client_info.js +++ b/jstests/auth/logs_include_client_info.js @@ -25,7 +25,7 @@ if (isJsonLog(conn)) { return log.id === 20250 && log.attr.principalName === "root" && log.attr.authenticationDatabase === "admin" && - /(?:\d{1,3}\.){3}\d{1,3}:\d+/.test(log.attr.client); + /(?:\d{1,3}\.){3}\d{1,3}:\d+/.test(log.attr.remote); } function checkSCRAMfail(element, index, array) { @@ -33,7 +33,7 @@ if (isJsonLog(conn)) { return log.id === 20249 && /SCRAM-SHA-\d+/.test(log.attr.mechanism) && log.attr.principalName === "root" && log.attr.authenticationDatabase === "admin" && - /(?:\d{1,3}\.){3}\d{1,3}:\d+/.test(log.attr.client); + /(?:\d{1,3}\.){3}\d{1,3}:\d+/.test(log.attr.remote); } assert(log.some(checkAuthSuccess)); diff --git a/jstests/ssl/x509_client.js b/jstests/ssl/x509_client.js index 00624c63a33..6a1bb26869c 100644 --- a/jstests/ssl/x509_client.js +++ b/jstests/ssl/x509_client.js @@ -49,7 +49,7 @@ function authAndTest(mongo, {clusterUserSeparationOveride = false} = {}) { return logJson.id === 20429 && logJson.attr.user === CLIENT_USER && logJson.attr.db === "$external" && - /(?:\d{1,3}\.){3}\d{1,3}:\d+/.test(logJson.attr.client); + /(?:\d{1,3}\.){3}\d{1,3}:\d+/.test(logJson.attr.remote); } assert(log.some(checkAuthSuccess)); } else { diff --git a/src/mongo/db/auth/sasl_commands.cpp b/src/mongo/db/auth/sasl_commands.cpp index 81d784e64a3..d352eeeb082 100644 --- a/src/mongo/db/auth/sasl_commands.cpp +++ b/src/mongo/db/auth/sasl_commands.cpp @@ -202,7 +202,7 @@ Status doSaslStep(OperationContext* opCtx, "mechanism"_attr = mechanism.mechanismName(), "principalName"_attr = mechanism.getPrincipalName(), "authenticationDatabase"_attr = mechanism.getAuthenticationDatabase(), - "client"_attr = opCtx->getClient()->getRemote().toString(), + "remote"_attr = opCtx->getClient()->getRemote(), "result"_attr = redact(swResponse.getStatus())); sleepmillis(saslGlobalParams.authFailedDelay.load()); @@ -231,7 +231,7 @@ Status doSaslStep(OperationContext* opCtx, "mechanism"_attr = mechanism.mechanismName(), "principalName"_attr = mechanism.getPrincipalName(), "authenticationDatabase"_attr = mechanism.getAuthenticationDatabase(), - "client"_attr = opCtx->getClient()->session()->remote()); + "remote"_attr = opCtx->getClient()->session()->remote()); } if (session->isSpeculative()) { status = authCounter.incSpeculativeAuthenticateSuccessful( diff --git a/src/mongo/db/commands/authentication_commands.cpp b/src/mongo/db/commands/authentication_commands.cpp index b9c48b18495..b969359e855 100644 --- a/src/mongo/db/commands/authentication_commands.cpp +++ b/src/mongo/db/commands/authentication_commands.cpp @@ -310,7 +310,7 @@ bool CmdAuthenticate::run(OperationContext* opCtx, "Successfully authenticated", "user"_attr = user.getUser(), "db"_attr = user.getDB(), - "client"_attr = opCtx->getClient()->session()->remote()); + "remote"_attr = opCtx->getClient()->session()->remote()); } uassertStatusOK(authCounter.incAuthenticateSuccessful(mechanism)); diff --git a/src/mongo/db/curop.cpp b/src/mongo/db/curop.cpp index b4c5e64d14a..4d03867b805 100644 --- a/src/mongo/db/curop.cpp +++ b/src/mongo/db/curop.cpp @@ -1085,6 +1085,10 @@ void OpDebug::report(OperationContext* opCtx, pAttrs->add("operationMetrics", builder.obj()); } + if (client && client->session()) { + pAttrs->add("remote", client->session()->remote()); + } + if (iscommand) { pAttrs->add("protocol", getProtoString(networkOp)); } diff --git a/src/mongo/transport/transport_layer_asio_test.cpp b/src/mongo/transport/transport_layer_asio_test.cpp index 9764e952b2e..d40f3fb5504 100644 --- a/src/mongo/transport/transport_layer_asio_test.cpp +++ b/src/mongo/transport/transport_layer_asio_test.cpp @@ -237,9 +237,7 @@ public: TimeoutSyncSEP(Mode mode) : _mode(mode) {} void startSession(transport::SessionHandle session) override { - LOGV2(23040, - "Accepted connection from {session_remote}", - "session_remote"_attr = session->remote()); + LOGV2(23040, "Accepted connection", "remote"_attr = session->remote()); startWorkerThread([this, session = std::move(session)]() mutable { LOGV2(23041, "waiting for message"); session->setTimeout(Milliseconds{500}); @@ -335,9 +333,7 @@ TEST(TransportLayerASIO, SourceSyncTimeoutSucceeds) { class TimeoutSwitchModesSEP : public TimeoutSEP { public: void startSession(transport::SessionHandle session) override { - LOGV2(23044, - "Accepted connection from {session_remote}", - "session_remote"_attr = session->remote()); + LOGV2(23044, "Accepted connection", "remote"_attr = session->remote()); startWorkerThread([this, session = std::move(session)]() mutable { LOGV2(23045, "waiting for message"); auto sourceMessage = [&] { return session->sourceMessage().getStatus(); }; |