diff --git a/src/go/pt-galera-log-explainer/main.go b/src/go/pt-galera-log-explainer/main.go index f3e94d19..bc177900 100644 --- a/src/go/pt-galera-log-explainer/main.go +++ b/src/go/pt-galera-log-explainer/main.go @@ -28,14 +28,15 @@ var ( var buildInfo = fmt.Sprintf("%s\nVersion %s\nBuild: %s using %s\nCommit: %s", toolname, Version, Build, GoVersion, Commit) var CLI struct { - NoColor bool - Since *time.Time `help:"Only list events after this date, format: 2023-01-23T03:53:40Z (RFC3339)"` - Until *time.Time `help:"Only list events before this date"` - Verbosity types.Verbosity `type:"counter" short:"v" default:"0" help:"-v: DebugMySQL (add every mysql info the tool used), -vv: Debug (internal tool debug)"` - PxcOperator bool `default:"false" help:"Analyze logs from Percona PXC operator. Off by default because it negatively impacts performance for non-k8s setups"` - ExcludeRegexes []string `help:"Remove regexes from analysis. List regexes using 'pt-galera-log-explainer regex-list'"` - MergeByDirectory bool `help:"Instead of relying on identification, merge contexts and columns by base directory. Very useful when dealing with many small logs organized per directories."` - SkipMerge bool `help:"Disable the ability to merge log files together. Can be used when every nodes have the same wsrep_node_name"` + NoColor bool + Since *time.Time `help:"Only list events after this date, format: 2023-01-23T03:53:40Z (RFC3339)"` + Until *time.Time `help:"Only list events before this date"` + Verbosity types.Verbosity `type:"counter" short:"v" default:"0" help:"-v: DebugMySQL (add every mysql info the tool used), -vv: Debug (internal tool debug)"` + PxcOperator bool `default:"false" help:"Analyze logs from Percona PXC operator. Will cause slow performance on non-k8s setups"` + SkipOperatorDetection bool `default:"false" help:"Skip auto detection of Percona PXC operator logs"` + ExcludeRegexes []string `help:"Remove regexes from analysis. List regexes using 'pt-galera-log-explainer regex-list'"` + MergeByDirectory bool `help:"Instead of relying on identification, merge contexts and columns by base directory. Very useful when dealing with many small logs organized per directories."` + SkipMerge bool `help:"Disable the ability to merge log files together. Can be used when every nodes have the same wsrep_node_name"` List list `cmd:""` //Whois whois `cmd:""` @@ -79,9 +80,10 @@ func main() { paths = CLI.Conflicts.Paths } - if !CLI.PxcOperator && areOperatorFiles(paths) { + if !CLI.PxcOperator && !CLI.SkipOperatorDetection && areOperatorFiles(paths) { CLI.PxcOperator = true log.Info().Msg("Detected logs coming from Percona XtraDB Cluster Operator, enabling --pxc-operator") + } translate.AssumeIPStable = !CLI.PxcOperator