From e2a0d45418be7638e5a73a5180e7b4be9698e90d Mon Sep 17 00:00:00 2001 From: Erisa A Date: Wed, 27 May 2026 12:30:28 +0100 Subject: [PATCH] cmd/tailscale/cli: fix time parsing in debug daemon-logs (#19875) Fixes #19874 Signed-off-by: Erisa A --- cmd/tailscale/cli/debug.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/cmd/tailscale/cli/debug.go b/cmd/tailscale/cli/debug.go index f6972f004..1e9314744 100644 --- a/cmd/tailscale/cli/debug.go +++ b/cmd/tailscale/cli/debug.go @@ -786,10 +786,13 @@ func runDaemonLogs(ctx context.Context, args []string) error { } d := json.NewDecoder(logs) for { + type logtail struct { + Time string `json:"client_time"` + } var line struct { - Text string `json:"text"` - Verbose int `json:"v"` - Time string `json:"client_time"` + Text string `json:"text"` + Verbose int `json:"v"` + Logtail logtail `json:"logtail"` } err := d.Decode(&line) if err != nil { @@ -799,8 +802,8 @@ func runDaemonLogs(ctx context.Context, args []string) error { if line.Text == "" || line.Verbose > daemonLogsArgs.verbose { continue } - if daemonLogsArgs.time { - fmt.Printf("%s %s\n", line.Time, line.Text) + if daemonLogsArgs.time && line.Logtail.Time != "" { + fmt.Printf("%s %s\n", line.Logtail.Time, line.Text) } else { fmt.Println(line.Text) }