Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] Tracking down the publisher of a message


I'll give that a try.

The only snag I see is if the client connected some time ago and never disconnected.


On Thu, 11 Nov 2021 at 09:54, Ben Hardill <hardillb@xxxxxxxxx> wrote:
IF you start mosquitto in verbose mode it will log the length of the
message it received.

e.g. The following show 2 mosquitto_pub clients connect, the first
published a payload of "ben" shown as 3 bytes, the second published a
null payload shown as 0 bytes.

The log line has the client id which can be matched to the earlier log
entry with the ip address.

$ mosquitto -p 1888 -v
1636624290: mosquitto version 2.0.13 starting
1636624290: Using default config.
1636624290: Starting in local only mode. Connections will only be
possible from clients running on this machine.
1636624290: Create a configuration file which defines a listener to
allow remote access.
1636624290: For more details see
1636624290: Opening ipv4 listen socket on port 1888.
1636624290: Opening ipv6 listen socket on port 1888.
1636624290: mosquitto version 2.0.13 running
1636624309: New connection from on port 1888.
1636624309: New client connected from as
auto-66D62DF4-D085-B93E-A3F7-859C745218AD (p2, c1, k60).
1636624309: No will message specified.
1636624309: Sending CONNACK to auto-66D62DF4-D085-B93E-A3F7-859C745218AD
(0, 0)
1636624309: Received PUBLISH from
auto-66D62DF4-D085-B93E-A3F7-859C745218AD (d0, q0, r0, m0, 'foo', ... (3
1636624309: Received DISCONNECT from
1636624309: Client auto-66D62DF4-D085-B93E-A3F7-859C745218AD disconnected.
1636624323: New connection from on port 1888.
1636624323: New client connected from as
auto-B3D3304F-9E2D-2A3D-29BB-0D3F213DE0F9 (p2, c1, k60).
1636624323: No will message specified.
1636624323: Sending CONNACK to auto-B3D3304F-9E2D-2A3D-29BB-0D3F213DE0F9
(0, 0)
1636624323: Received PUBLISH from
auto-B3D3304F-9E2D-2A3D-29BB-0D3F213DE0F9 (d0, q0, r0, m0, 'foo', ... (0
1636624323: Received DISCONNECT from
1636624323: Client auto-B3D3304F-9E2D-2A3D-29BB-0D3F213DE0F9 disconnected.

On 11/11/2021 09:45, Andrew Holt wrote:
> Hi,
> It's my own fault.
> On my (dev) network, somewhere, I have a client that is publishing a
> message with a NULL topic.
> What I would like to do is to find the IP address of the publisher.
> If there is some way to get the broker to log the source of a message
> that would be ideal, but I'm open to other suggestions.
> Thanks,
> Andrew
> P.S. It's my own fault.
> _______________________________________________
> mosquitto-dev mailing list
> mosquitto-dev@xxxxxxxxxxx
> To unsubscribe from this list, visit

mosquitto-dev mailing list
To unsubscribe from this list, visit

Back to the top