you can use this option multiple time.
--exclude-file filename: path of the file which contains all the regex to use
to exclude queries from the report. One regex per line.
+ --include-query regex : any query that do not match the given regex will be
+ excluded from the report. For example: "(table_1|table_2)"
+ you can use this option multiple time.
+ --include-file filename: path of the file which contains all the regex of the
+ queries to include from the report. One regex per line.
--disable-error : do not generate error report.
--disable-hourly : do not generate hourly reports.
--disable-type : do not generate query type report.
you can use this option multiple time.
--exclude-file filename: path of the file which contains all the regex to use
to exclude queries from the report. One regex per line.
+ --include-query regex : any query that do not match the given regex will be
+ excluded from the report. For example: "(table_1|table_2)"
+ you can use this option multiple time.
+ --include-file filename: path of the file which contains all the regex of the
+ queries to include from the report. One regex per line.
--disable-error : do not generate error report.
--disable-hourly : do not generate hourly reports.
--disable-type : do not generate query type report.
my $error_only = 0;
my @exclude_query = ();
my $exclude_file = '';
+my @include_query = ();
+my $include_file = '';
my $disable_error = 0;
my $disable_hourly = 0;
my $disable_type = 0;
"image-format=s" => \$img_format,
"exclude-query=s" => \@exclude_query,
"exclude-file=s" => \$exclude_file,
+ "include-query=s" => \@exclude_query,
+ "include-file=s" => \$exclude_file,
"disable-error!" => \$disable_error,
"disable-hourly!" => \$disable_hourly,
"disable-type!" => \$disable_type,
}
}
+# Loading included query from file if any
+if ($include_file) {
+ open(IN, "$include_file") or die "FATAL: can't read file $include_file: $!\n";
+ my @exclq = <IN>;
+ close(IN);
+ chomp(@exclq);
+ map {s/\r//;} @exclq;
+ foreach my $r (@exclq) {
+ &check_regex($r, '--include-file');
+ }
+ push(@include_query, @exclq);
+}
+
+# Testing regex syntaxe
+if ($#include_query >= 0) {
+ foreach my $r (@include_query) {
+ &check_regex($r, '--include-query');
+ }
+}
+
my $other_syslog_line = qr/^(...)\s+(\d+)\s(\d+):(\d+):(\d+)\s([^\s]+)\s([^\[]+)\[(\d+)\]:\s\[(\d+)\-\d+\]\s*(.*)/;
my $orphan_syslog_line = qr/^...\s+\d+\s\d+:\d+:\d+\s[^\s]+\s[^\[]+\[\d+\]:/;
my $orphan_stderr_line = qr/[^']*\d+-\d+-\d+\s\d+:\d+:\d+[\.\d]*\s[^\s]+[^']*/;
you can use this option multiple time.
--exclude-file filename: path of the file which contains all the regex to use
to exclude queries from the report. One regex per line.
+ --include-query regex : any query that do not match the given regex will be
+ excluded from the report. For example: "(table_1|table_2)"
+ you can use this option multiple time.
+ --include-file filename: path of the file which contains all the regex of the
+ queries to include from the report. One regex per line.
--disable-error : do not generate error report.
--disable-hourly : do not generate hourly reports.
--disable-type : do not generate query type report.
}
}
+ # Should we have to include only some queries
+ if ($#include_query >= 0) {
+ foreach (@include_query) {
+ if ($cur_info{$t_pid}{query} !~ /$_/i) {
+ $cur_info{$t_pid}{query} = '';
+ return;
+ }
+ }
+ }
+
# Truncate the query if requested by the user
$cur_info{$t_pid}{query} = substr($cur_info{$t_pid}{query}, 0, $maxlength) . '[...]'
if (($maxlength > 0) && (length($cur_info{$t_pid}{query}) > $maxlength));