diff options
author | Jon Bratseth <bratseth@oath.com> | 2020-07-01 14:24:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-01 14:24:39 +0200 |
commit | b6bc5ce6319b1fe73c181bcf2b25a28a64bb9701 (patch) | |
tree | 20eac3901b3d2efd7804d2f1b88231c0b1c8b9cd | |
parent | 7a6ed60fa87311e00d07d0499bad3cfc3d3a3dba (diff) | |
parent | 96d228979d9c527cee44932fdca1bbbca2fd9ac8 (diff) |
Merge pull request #13767 from vespa-engine/arnej/logfmt-filter-plugin-messages
filter log messages from plugins
-rwxr-xr-x | vespalog/src/vespa-logfmt/vespa-logfmt.pl | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/vespalog/src/vespa-logfmt/vespa-logfmt.pl b/vespalog/src/vespa-logfmt/vespa-logfmt.pl index f15a44d4419..78e06aa5845 100755 --- a/vespalog/src/vespa-logfmt/vespa-logfmt.pl +++ b/vespalog/src/vespa-logfmt/vespa-logfmt.pl @@ -50,6 +50,7 @@ my $msgtxre; my $onlypid; my $onlysvc; my $onlyhst; +my $onlyint; my $shortsvc; my $shortcmp; @@ -67,6 +68,7 @@ GetOptions ('level|l=s' => \@optlevels, 'service|S=s' => \$onlysvc, 'show|s=s' => \@optshow, 'pid|p=s' => \$onlypid, + 'internal|i' => \$onlyint, 'component|c=s' => \$compore, 'message|m=s' => \$msgtxre, 'help|h' => \$opthelp, @@ -107,6 +109,7 @@ if ( $opthelp || $bad ) { " -N\t\t--nldequote\t\tdequote newlines in message text field\n", " -t\t--tc\t--truncatecomponent\tchop component to 15 chars\n", " --ts\t\t--truncateservice\tchop service to 9 chars\n", + " -i\t\t--internal\t\tfilter out plugin-generated messages\n", "\n", "FIELDLIST is comma separated, available fields:\n", "\t time fmttime msecs usecs host level pid service component message\n", @@ -172,6 +175,31 @@ if ( $optshow ) { # foreach ( keys %showflags ) ; } +my $only_internal_regexp = qr/^ + [^.]*[.] + ( ai[.]vespa[.] | + com[.]yahoo[.] + ( application | binaryprefix | clientmetrics | + collections | component | compress | + concurrent | config | configtest | + container | data | docproc | docprocs | + document | documentapi | documentmodel | + dummyreceiver | errorhandling | exception | + feedapi | feedhandler | filedistribution | + fs4 | fsa | geo | io | javacc | jdisc | + jrt | lang | language | log | logserver | + messagebus | metrics | net | osgi | path | + plugin | prelude | processing | protect | + reflection | restapi | search | + searchdefinition | searchlib | security | + slime | socket | statistics | stream | + system | tensor | test | text | + time | transaction | vdslib | vespa | + vespaclient | vespafeeder | vespaget | + vespastat | vespasummarybenchmark | + vespavisit | vespaxmlparser | yolean ) + )[.]/x ; + while (<>) { chomp; if ( /^ @@ -205,6 +233,12 @@ while (<>) { } next unless ( $levelflags{$levl} ); + # for now, only filter plugins in "Container" + if ($onlyint && $comp =~ m/^Container[.]/) { + if ($comp !~ m/$only_internal_regexp/) { + next; + } + } if ($compore && $comp !~ m/$compore/o) { next; } if ($msgtxre && $msgt !~ m/$msgtxre/o) { next; } if ($onlypid && $pidn ne $onlypid) { next; } |