I’ve found this old topic that explains how to parse it from the rpc output used by the browser UI:
Since it is 4 years old I though I’ll try asking if there’s some way to get this via CLI nowadays.
I’ve tried this:
syncthing cli show connections \
| jq -r '.connections | to_entries[] | "\(.key);\(.value.at)"' \
| while IFS=';' read -r id timestamp; do
name=$(syncthing cli config devices "$id" name get)
echo "$timestamp;$name"
done \
| sort -r
But that gives me “0001-01-01T00:00:00Z” for devices that are not currently connected, and only the current timestamp for devices that are. Not equivalent and as useful as the “last seen” timestamp available in the Web-UI.
What I find kind of strange is that the peer I’m quering this from always lists itself too with the last seen timestamp of “1970-01-01T01:00:00+01:00”..