From a9bf1d54c1eb77c9b5eafef9d1d3db7511ded9c8 Mon Sep 17 00:00:00 2001 From: Ben Tasker <88340935+btasker@users.noreply.github.com> Date: Mon, 7 Nov 2022 16:54:22 +0000 Subject: [PATCH] fix: don't write skipped shard messages to the line protocol output destination (#23727) This switches so that the message skipped missing file: /path/to/tsm.tsm is written to stdErr instead of stdout (or the output file if `-out` has been provided) --- cmd/influx_inspect/export/export.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/influx_inspect/export/export.go b/cmd/influx_inspect/export/export.go index 61c5525eb9..0906f02af9 100644 --- a/cmd/influx_inspect/export/export.go +++ b/cmd/influx_inspect/export/export.go @@ -340,7 +340,7 @@ func (cmd *Command) exportTSMFile(tsmFilePath string, w io.Writer) error { f, err := os.Open(tsmFilePath) if err != nil { if os.IsNotExist(err) { - fmt.Fprintf(w, "skipped missing file: %s", tsmFilePath) + fmt.Fprintf(cmd.Stderr, "skipped missing file: %s", tsmFilePath) return nil } return err @@ -408,7 +408,7 @@ func (cmd *Command) exportWALFile(walFilePath string, w io.Writer, warnDelete fu f, err := os.Open(walFilePath) if err != nil { if os.IsNotExist(err) { - fmt.Fprintf(w, "skipped missing file: %s", walFilePath) + fmt.Fprintf(cmd.Stderr, "skipped missing file: %s", walFilePath) return nil } return err