Get the connection id of a particular running instance

Is there any way to get the connection id of a particular instance that is running on a system after it has been run? I am aware of how to get the list of connections for a particular tunnel by querying the API or using the info command. But, I can’t figure out which system a particular connection refers to.

One way could be to check the logs when a connection starts but since I am looking for an automatic way to figure this out, parsing log files seems to be a very brittle way. Any ideas in this regard?

If you know the IP of the origin server that the tunnel is running on, then you match connectors that way.

Yeah, I have considered that, but the situation is that all the connections are created within a home cluster and the origin IP shown for each connection is my home IP address so its the same for all the connections. I also noticed that I could create tags while creating a tunnel but not while running them. Else, that would have been a sure shot way to identify the connections.

I figured this was the case. You could make a feature request for cloudflared. But if you want an imminent solution, then you are going to have to parse the logs.

Ugh, yeah. I will probably create a PR and use my fork for the time being. Hopefully the maintainers like it :sweat_smile:

This was opened in 💡Get the connection id of a particular running instance · Issue #684 · cloudflare/cloudflared · GitHub and I’ve provided feedback there.

1 Like

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