% 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: 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_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: 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,}


%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

