+add filter-id like we do for filter-resource
Useful if we do not want to set a long comma separated list of id, just a pattern
This commit is contained in:
parent
98b127848c
commit
a4644f2cf9
|
@ -51,6 +51,7 @@ sub new {
|
||||||
"timezone:s" => { name => 'timezone' },
|
"timezone:s" => { name => 'timezone' },
|
||||||
"description" => { name => 'description' },
|
"description" => { name => 'description' },
|
||||||
"filter-resource:s" => { name => 'filter_resource' },
|
"filter-resource:s" => { name => 'filter_resource' },
|
||||||
|
"filter-id:s" => { name => 'filter_id' },
|
||||||
"exclude-id:s" => { name => 'exclude_id' },
|
"exclude-id:s" => { name => 'exclude_id' },
|
||||||
});
|
});
|
||||||
$self->{result} = {};
|
$self->{result} = {};
|
||||||
|
@ -151,7 +152,8 @@ sub run {
|
||||||
|
|
||||||
next if (defined($self->{option_results}->{filter_resource}) && $self->{option_results}->{filter_resource} ne '' &&
|
next if (defined($self->{option_results}->{filter_resource}) && $self->{option_results}->{filter_resource} ne '' &&
|
||||||
$resource_name !~ /$self->{option_results}->{filter_resource}/);
|
$resource_name !~ /$self->{option_results}->{filter_resource}/);
|
||||||
|
next if (defined($self->{option_results}->{filter_id}) && $self->{option_results}->{filter_id} ne '' &&
|
||||||
|
$identifier !~ /$self->{option_results}->{filter_id}/);
|
||||||
$total_error++;
|
$total_error++;
|
||||||
if (defined($self->{option_results}->{description})) {
|
if (defined($self->{option_results}->{description})) {
|
||||||
$self->{output}->output_add(long_msg => sprintf("Error '%s' Date: %s ResourceName: %s Description: %s", $identifier,
|
$self->{output}->output_add(long_msg => sprintf("Error '%s' Date: %s ResourceName: %s Description: %s", $identifier,
|
||||||
|
@ -242,6 +244,10 @@ Print error description in long output. [ Error 'CODE' Date: Timestamp ResourceN
|
||||||
|
|
||||||
Filter resource (can use a regexp).
|
Filter resource (can use a regexp).
|
||||||
|
|
||||||
|
=item B<--filter-id>
|
||||||
|
|
||||||
|
Filter error code (can use a regexp).
|
||||||
|
|
||||||
=item B<--exclude-id>
|
=item B<--exclude-id>
|
||||||
|
|
||||||
Filter on specific error code (can be a comma separated list).
|
Filter on specific error code (can be a comma separated list).
|
||||||
|
|
Loading…
Reference in New Issue