mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-20 02:44:58 +00:00
pt-galera-log-explainer: add --skip-merge, grep -a
--skip-merge can help for cases where merge won't work: node names intentionally identical grep -a enables to read logs even though they use binary format
This commit is contained in:
@@ -69,7 +69,7 @@ func timelineFromPaths(paths []string, regexes types.RegexMap) (types.Timeline,
|
||||
// Why it should not just identify using the file path:
|
||||
// so that we are able to merge files that belong to the same nodes
|
||||
// we wouldn't want them to be shown as from different nodes
|
||||
if CLI.PxcOperator {
|
||||
if CLI.PxcOperator || CLI.SkipMerge {
|
||||
timeline[path] = localTimeline
|
||||
} else if CLI.MergeByDirectory {
|
||||
timeline.MergeByDirectory(path, localTimeline)
|
||||
@@ -129,7 +129,7 @@ func execGrepAndIterate(path, compiledRegex string, stdout chan<- string) error
|
||||
logger.Warn().Msg("On Darwin systems, use 'pt-galera-log-explainer --grep-cmd=ggrep' as it requires grep v3")
|
||||
}
|
||||
|
||||
cmd := exec.Command(CLI.GrepCmd, "-P", compiledRegex, path)
|
||||
cmd := exec.Command(CLI.GrepCmd, "-a", "-P", compiledRegex, path)
|
||||
|
||||
out, err := cmd.StdoutPipe()
|
||||
if err != nil {
|
||||
|
@@ -35,6 +35,7 @@ var CLI struct {
|
||||
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"`
|
||||
|
||||
List list `cmd:""`
|
||||
//Whois whois `cmd:""`
|
||||
|
Reference in New Issue
Block a user