--exclude-time regex : any timestamp matching the given regex will be
excluded from the report. Example: "2013-04-12 .*"
You can use this option multiple times.
+ --include-time regex : only timestamps matching the given regex will be
+ included in the report. Example: "2013-04-12 .*"
+ You can use this option multiple times.
--exclude-appname name : exclude entries for the specified application name
from report. Example: "pg_dump".
--exclude-line regex : pgBadger will start to exclude any log entry that
my $error_only = 0;
my @exclude_query = ();
my @exclude_time = ();
+my @include_time = ();
my $exclude_file = '';
my @include_query = ();
my $include_file = '';
"disable-autovacuum!" => \$disable_autovacuum,
"charset=s" => \$charset,
"csv-separator=s" => \$csv_sep_char,
+ "include-time=s" => \@include_time,
"exclude-time=s" => \@exclude_time,
'ssh-command=s' => \$ssh_command,
'ssh-program=s' => \$ssh_bin,
&check_regex($r, '--exclude-time');
}
}
+#
+# Testing regex syntax
+if ($#include_time >= 0) {
+ foreach my $r (@include_time) {
+ &check_regex($r, '--include-time');
+ }
+}
# Loading included query from file if any
if ($include_file) {
--exclude-time regex : any timestamp matching the given regex will be
excluded from the report. Example: "2013-04-12 .*"
You can use this option multiple times.
+ --include-time regex : only timestamps matching the given regex will be
+ included in the report. Example: "2013-04-12 .*"
+ You can use this option multiple times.
--exclude-appname name : exclude entries for the specified application name
from report. Example: "pg_dump".
--exclude-line regex : pgBadger will start to exclude any log entry that
return 1 if ($found);
}
+ if ($#include_time >= 0) {
+ my $found = 0;
+ foreach (@include_time) {
+ if ($prefix_vars{'t_timestamp'} !~ /$_/) {
+ $found = 1;
+ last;
+ }
+ }
+ return 1 if ($found);
+ }
+
+
return 1 if ($from && ($from gt $prefix_vars{'t_timestamp'}));
if ($to && ($to lt $prefix_vars{'t_timestamp'})) {