% This file contains the generic filters which can be used with
% every data set when running the test. This file is processed
% once at the beginning of the test and all filters are stored.
%
% The filter format is as follows:
% filter:   name, single
% ack:      regexp, multiple
% notif:    regexp, multiple
% forw:     regexp, multiple
%
% regexp is ordinaly Perl regexp with some specific extentions.
% see documentation for more details
% 
% If the attrubute is omitted, it will not be checked.
% "filter" is a mandatory attribute, and at least one other
% attribute must be specified to have meaningful filter.
% These syntax checks are performed when filters are parsed.
%
% The filter names can be used in "object" decriptions in
% filters_local.config configuration files for each data set to
% specify the filter in "body" attribute.
% Also custom filters can be defined in these local
% configuration files.

%ack only filters

%filter: ack_sum_ok
%ack: Number of objects processed successfully:\s*$0
%ack:   Create:\s*$1
%ack:   Modify:\s*$2
%ack:   Delete:\s*$3
%ack:   No Operation:\s*$4

%filter: ack_sum_fail
%ack: Number of objects processed with errors:\s*$0
%ack:   Create:\s*$1
%ack:   Modify:\s*$2
%ack:   Delete:\s*$3
%ack:   Syntax Errors:\s*$4

filter: ack_sum_found
ack: Number of objects found:\s*$0

filter: ack_sum_ok
ack: Number of objects processed successfully:\s*$0\n\s*Create:\s*$1\n\s*Modify:\s*$2\n\s*Delete:\s*$3\n\s*No Operation:\s*$4

filter: ack_sum_fail
ack: Number of objects processed with errors:\s*$0\s*Create:\s*$1\s*Modify:\s*$2\s*Delete:\s*$3\s*Syntax Errors:\s*$4

filter: no_ack_sum_found
ack: ! Number of objects found:

filter: msg_garbage
ack: The following paragraph\(s\) do not look like objects\nand were NOT PROCESSED:\n\n$0

filter: no_msg_garbage
ack: ! The following paragraph\(s\) do not look like objects\nand were NOT PROCESSED:\n\n$0

filter: obj_forw_create
ack: \*\*\*Info: $0: objects cannot be created automatically\n         The object has been forwarded to the RIPE\n         Database Administration for authorisation\.\n         You will receive further notification when \n         this request is processesed\.\n         No further action from your part is required\.

filter: obj_forw_policy
ack: \*\*\*Info: A policy check failed on this object\.\n         It has been forwarded to the AfriNic\n         Database Administration for review\.\n         You will receive further notification when \n         this review is completed\.\n         No further action from your part is required\.


filter: syntax_ok
ack: \*\*\*Info: Syntax check passed

% in normal cases a syntax error means the update failed
filter: syntax_err
ack: Update FAILED:
ack: \*\*\*Error: Syntax error in object

% delete operations may continue after a syntax error
filter: syntax_err_delete
ack: \*\*\*Error: Syntax error in object

filter: auth_ok
ack: \*\*\*Info: Authorisation passed

filter: auth_err
ack: \*\*\*Error: Authorisation failed

filter: auth_info_none
ack: \*\*\*Info: Authorisation for $0 \[$1\] $2\n\s*using $3\n\s*no valid maintainer found\n

filter: auth_info_none_irt
ack: \*\*\*Info: Authorisation for $0 \[$1\] $2\n\s*using $3\n\s*no valid irt found\n

filter: auth_info_none_org
ack: \*\*\*Info: Authorisation for $0 \[$1\] $2\n\s*using $3\n\s*no valid organisation found\n

filter: auth_info_pass
ack: \*\*\*Info: Authorisation for $0 \[$1\] $2\n\s*using $3\n\s*authenticated by: $4\n

filter: auth_info_fail
ack: \*\*\*Info: Authorisation for $0 \[$1\] $2\n\s*using $3\n\s*not authenticated by: $4\n

filter: auth_info_comb
ack: \*\*\*Info: Authorisation for $0 \[$1\] $2\n\s*using $3\n\s*authenticated by: $4\n\s*not authenticated by: $5\n

filter: auth_info_none_ov
ack: \*\*\*Info: Authorisation for $0 \[$1\] $2\n\s*using $3\n\s*no valid maintainer found\n\s*Authorisation override used\n

filter: auth_info_pass_ov
ack: \*\*\*Info: Authorisation for $0 \[$1\] $2\n\s*using $3\n\s*authenticated by: $4\n\s*Authorisation override used\n

filter: auth_info_fail_ov
ack: \*\*\*Info: Authorisation for $0 \[$1\] $2\n\s*using $3\n\s*not authenticated by: $4\n\s*Authorisation override used\n

filter: auth_info_comb_ov
ack: \*\*\*Info: Authorisation for $0 \[$1\] $2\n\s*using $3\n\s*authenticated by: $4\n\s*not authenticated by: $5\n\s*Authorisation override used\n

filter: no_auth_info
ack: ! \*\*\*Info: Authorisation for

% the first string ($0) should be parent inetnum range
% other strings ($1, $2, $3) should be allowed parent statuses, sep. by ", or "
filter: parent_status_error_three
ack: \*\*\*Error: parent $0 does not have "status:"\n[\s]+$1, or $2, or $3 

% multiple parents error - ok for 2 parents
filter: multiple_parents_error
ack: \*\*\*Error: The following multiple overlapping parents were found:\s*\n\s*$0,\s*\n\s*$1\s*\n

% multiple parents info
filter: multiple_parents_info
ack: \*\*\*Info: All but one of these parent networks must be\s*\n\s*deleted before the child can be created.\s*\n\s*If you are not the maintainer of the invalid parent\(s\),\s*\n\s*please contact the maintainer\.\s*\n

% overlapping_inetnum error - ok for 1 overlap
filter: overlap_error
ack: \*\*\*Error: This inetnum overlaps with the following:\s*\n\s*$0\s*\n

% overlapping_inetnum error - ok for 2 overlaps
filter: overlap_error_two
ack: \*\*\*Error: This inetnum overlaps with the following:\s*\n\s*$0,\s*\n\s*$1\s*\n

% overlapping inetnum info
filter: overlap_info
ack: \*\*\*Info: This conflict must be resolved before\s*\n\s*the inetnum can be created\.\s*\n\s*If you are not the maintainer of the conflicting inetnum\(s\),\s*\n\s*please contact the maintainer\.\s*\n

% invalid prefix ranges error 2
filter: invalid_prefrange_warn
ack: \*\*\*Warning: The $0 \[$1\] $2\s*\n\s*has invalid prefix ranges in \"mnt-routes:\" attribute\(s\):\s*\n\s*$3\, $4\s*\n 

% invalid prefix ranges info 1
filter: invalid_prefrange_info
ack: \*\*\*Info: Therefore the following mntners will not be checked:\s*\n\s*$0\s*\n

% no applicable mntners found
filter: no_mntners_error
ack: \*\*\*Error: The $0 \[$1\] $2\s*\n\s*contains no applicable maintainers for this route\s*\n\s*in "mnt-routes:" attribute\(s\)\.\s*\n

filter: preproc_range_conversion
ack: \*\*\*Warning: Prefix '$0' converted to range '$1'\n

filter: preproc_range_conversion_failed
ack: \*\*\*Error: Failed to convert '$0' into range notation\n

%filter: auth_using
%ack: using $0

%filter: auth_by
%ack: authenticated by: $0

%filter: not_auth_by
%ack: not authenticated by: $0

filter: create_ok
ack: Create SUCCEEDED:

filter: create_failed
ack: Create FAILED:

filter: modify_ok
ack: Modify SUCCEEDED:

filter: modify_failed
ack: Modify FAILED:

filter: delete_ok
ack: Delete SUCCEEDED:

filter: delete_failed
ack: Delete FAILED:

filter: update_failed
ack: Update FAILED:

filter: noop_ok
ack: No Operation:




filter: help_msg
$0: You have requested Help information from the RIPE NCC Database,
$0: therefore the body of your message has been ignored.

filter: no_help_msg
$0: ! You have requested Help information from the RIPE NCC Database,
$0: ! therefore the body of your message has been ignored.

%filter: std_out_help
%stdout: You have requested Help information from the RIPE NCC Database,
%stdout: therefore the body of your message has been ignored.

%filter: help_msg
%ack: You have requested Help information from the RIPE NCC Database,
%ack: therefore the body of your message has been ignored.

%filter: no_help_msg
%ack: ! You have requested Help information from the RIPE NCC Database,
%ack: ! therefore the body of your message has been ignored.

%filter: std_err  <-- use string(stderr, ......)
%stderr: $0

filter: string
$0: $1

filter: not_string
$0: ! $1

filter: upd_str
upd: $0

filter: ack_string
ack: $0

%filter: not_ack_string
%ack: ! $0

% start of record seperator in log files
filter: sor
$0: ^>>>.*$1.*<<<$

filter: not_sor
$0: ! ^>>>.*$1.*<<<$

%filter: ack_sor
%ack: ^>>>.*$0.*<<<$

%filter: upd_sor
%upd: ^>>>.*$0.*<<<$

%filter: not_upd_sor
%upd: ! ^>>>.*$0.*<<<$

filter: no_output
$0: !

%filter: no_stdout
%stdout: !

%filter: no_ack
%ack: !

%filter: obj_not_found
%ack: !

filter: int_err
$0: \*\*\*Error: An internal software error has occured. Please re-submit your update.
$0: If the problem persists please contact <ripe-dbm@ripe.net> for advice.

%filter: int_err
%ack: \*\*\*Error: An internal software error has occured. Please re-submit your update.
%ack: If the problem persists please contact <ripe-dbm@ripe.net> for advice.

filter: obj_class
$0: $1:\s*$2

filter: no_obj_class
$0: ! $1:\s*$2

%filter: obj_class
%ack: $0:\s*$1

%filter: upd_obj_class
%upd: $0:\s*$1

%filter: no_obj_class
%ack: ! $0:\s*$1

filter: obj_info
$0: \*\*\*Info:\s*$1

filter: no_obj_info
$0: ! \*\*\*Info:

%filter: obj_info
%ack: \*\*\*Info:\s*$0

%filter: no_obj_info
%ack: ! \*\*\*Info:

filter: obj_warn
$0: \*\*\*Warning:\s*$1

filter: no_obj_warn
$0: ! \*\*\*Warning:

%filter: obj_warn
%ack: \*\*\*Warning:\s*$0

%filter: no_obj_warn
%ack: ! \*\*\*Warning:

filter: obj_error
$0: \*\*\*Error:\s*$1

filter: no_obj_error
$0: ! \*\*\*Error:

%filter: obj_error
%ack: \*\*\*Error:\s*$0

%filter: no_obj_error
%ack: ! \*\*\*Error:

% the second parameter ($1) should be the string expected 
% the third number ($2) should be number of occurences of this string expected
% the fourth number ($3) should be the number of occurences expected +1
filter: count_string
$0: ($1){$2,$2}
$0: ! ($1){$3,}

% the first number ($1) should be the number of info expected
% the second number ($2) should be the number of info expected +1
filter: count_info
$0: (\*\*\*Info:.*?\n){$1,$1}
$0: ! (\*\*\*Info:.*\n){$2,}

% the first number ($0) should be the number of info expected
% the second number ($1) should be the number of info expected +1
%filter: count_info
%ack: (\*\*\*Info:.*?\n){$0,$0}
%ack: ! (\*\*\*Info:.*\n){$1,}

% the first number ($1) should be the number of warnings expected
% the second number ($2) should be the number of warnings expected +1
filter: count_warn
$0: (\*\*\*Warning:.*?\n){$1,$1}
$0: ! (\*\*\*Warning:.*\n){$2,}

% the first number ($0) should be the number of warnings expected
% the second number ($1) should be the number of warnings expected +1
%filter: count_warn
%ack: (\*\*\*Warning:.*?\n){$0,$0}
%ack: ! (\*\*\*Warning:.*\n){$1,}

% the first number ($1) should be the number of errors expected
% the second number ($2) should be the number of errors expected +1
filter: count_error
$0: (\*\*\*Error:.*?\n){$1,$1}
$0: ! (\*\*\*Error:.*?\n){$2,}

% the first number ($0) should be the number of errors expected
% the second number ($1) should be the number of errors expected +1
%filter: count_error
%ack: (\*\*\*Error:.*?\n){$0,$0}
%ack: ! (\*\*\*Error:.*?\n){$1,}

% custom error count for AS0.n related error
% $0 = max. errors. $1 = $0+1
filter: count_asn_err
ack: (\*\*\*Error: The RIPE Database represents AS numbers in \'ASn\' notation$.*){$0,$0}
ack: ! (\*\*\*Error: The RIPE Database represents AS numbers in \'ASn\' notation$.*){$1,}

% custom error count for community related error
% $0 = community number $1 = max. errors. $2 = $1+1
filter: count_comm_err
ack: (\*\*\*Error: Community number \"$0\" contains an invalid number$.*){$1,$1}
ack: ! (\*\*\*Error: Community number \"$0\" contains an invalid number$.*){$2,}

% custom error count for community related error
% $0 = community number $1 = max. errors. $2 = $1+1
filter: count_comm_range_err
ack: (\*\*\*Error: community element \"$0\" is not between 1 and 4294967295$.*){$1,$1}
ack: ! (\*\*\*Error: community element \"$0\" is not between 1 and 4294967295$.*){$2,}

% simple syntax error
% the first number ($0) should be the number of syntax errors expected
% the second number ($1) should be the number of syntax errors expected +1
filter: count_syntax_err
ack: (\*\*\*Error: syntax error$.*){$0,$0}
ack: ! (\*\*\*Error: syntax error$.*){$1,}

% syntax error on an attribute
% $0 = attribute, $1 = max. errors, $2 = $1 + 1
filter: count_syntax_err_attr
ack: (\*\*\*Error: Syntax error in \"$0\"$.*){$1,$1}
ack: ! (\*\*\*Error: Syntax error in \"$0\"$.*){$2,}

% numeric value X must be between Y and Z
% $0, $1, $2 = values in error message, $3= max. errors, $4 = $3 + 1
filter: count_numeric_attr_between_err
ack: (\*\*\*Error: Numeric value \"$0" must be between $1 and $2$.*){$3,$3}
ack: ! (\*\*\*Error: Numeric value \"$0" must be between $1 and $2$.*){$4,$4}

%filter: hier_auth
%ack: ^Hierarchical [Aa]uthorisation failed

%filter: auth
%ack: ^[Aa]uthorisation failed

% for route authorisation
%filter: route_ok
%ack: ^New[\s]+OK:[\s]+\[route\][\s]+20.13.0.0/16

%filter: route_failed
%ack: ^New[\s]+FAILED:[\s]+\[route\][\s]+20.13.0.0/16
%ack: ^Hierarchical authorisation failed, request forwarded to maintainer

% error 32
%filter: err32
%ack: Error no 32

%
% rDNS related stuff
%

% RDNSauth failed
filter: rdns_auth_fail
ack: \*\*\*Error: RDNS Authorisation failed

% RDNSrir
filter: rdns_rir
ack: \*\*\*Info: Majority RIR is $0\.

% RDNSuseotherrir
filter: rdns_use_other_rir
ack: \*\*\*Error: RIPE NCC is currently not responsible for the delegation

% RDNScannotregister
filter: rdns_cannot_register
ack: \*\*\*Error: This domain object cannot be registered\.

% RDNSnonservers
filter: rdns_nonservers
ack: \*\*\*Error: Domain object contains no name servers\.

% RDNSnotdelegated
filter: rdns_not_delegated
ack: \*\*\*Error: RIPE NCC is currently not responsible for the delegation

% RDNSdelcheckwarning
filter: rdns_delcheck_warning
ack: \*\*\*Warning: $0

% RDNSthreshold
filter: rdns_threshold
ack: \*\*\*Error: There are 20 or more problem points\.

% RDNSremovedtrailingdot
filter: rdns_removed_trailing_dot
ack: \*\*\*Warning: Trailing dot has been removed from .*\.

% RDNSparenthasourns
filter: rdns_parent_has_our_ns
ack: \*\*\*Info: Parent has nameservers of RIPE NCC\.

% RDNSoverlap
filter: rdns_overlap
ack: \*\*\*Error: Overlapping parent inetnum objects found\.

% RDNSinvalidrange
filter: rdns_invalid_range
ack: The following domain object\(s\) contain an invalid range for decomposition
ack: and were NOT PROCESSED:
ack: domain:

filter: status_adminmntner
ack: \*\*\*Error: ALLOCATED inetnum objects require the administrative maintainer.
ack: \s*You probably want "status: ASSIGNED PA".

filter: status_adminmntner6
ack: \*\*\*Error: ALLOCATED-BY-RIR inet6num objects require the administrative
ack: \s*maintainer.

filter: no_parent
ack: \*\*\*Error: There is no parent object

filter: mem_auth
ack: \*\*\*Error: Membership authorisation failure

filter: no_origin
ack: \*\*\*Error: The origin AS object does not exist

