Unknow number after ip from client

Hi! anyone can tell me what is that number after the client ip?

2022-05-10T21:09:18.455+0000 I NETWORK [thread1] connection accepted from 127.0.0.1:42969 #5 (3 connections now open)
2022-05-10T21:09:18.455+0000 I NETWORK [thread1] connection accepted from 127.0.0.1:42970 #6 (4 connections now open)

I tried to find which file handle the log output on the source code to figure out but with no luck.
Anyone know?

Hi @andres_cozme,

You can search the relevant version of server source code for a unique string like “connection accepted from” to find relevant log lines. Based on the log format in your output, you’re working with a version older than MongoDB 4.4 (which switched to structured logging using JSON).

For example, matching this line in the MongoDB v4.2 source:

The value after the IP address (eg 42969) is the ephemeral port associated with the TCP/IP connection.

Regards,
Stennie

Hi Stennie! thanks for the quick reply.

The first thing I tried was searching for the string "connection accepted from " using the github searcher on the mongo repository but I didn’t found anything. Maybe I’m using it wrong.

best regards
Andres

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.