[MXS-98] regexfilter log Created: 2015-04-15  Updated: 2017-12-01  Resolved: 2015-05-01

Status: Closed
Project: MariaDB MaxScale
Component/s: regexfilter
Affects Version/s: None
Fix Version/s: 1.1.1

Type: New Feature Priority: Minor
Reporter: Joffrey MICHAIE (Inactive) Assignee: markus makela
Resolution: Fixed Votes: 0
Labels: None


 Description   

Hi,

I don't think it is currently possible to trace the regexpfilter.
It would be great to have the possibility to enable something similar as Apache mod_rewrite RewriteLog for RewriteRule(s).

Example:
1) Enable regexfilterlog
2) Watch in the log
regexp(query|regex1): fail
regexp(query|regex2): fail
regexp(query|regex3): match
rewritten query to : query_rewritten

That would make it more easy to debug regular expressions in maxcale.

Thanks,
Joffrey



 Comments   
Comment by markus makela [ 2015-05-01 ]

Added optional logging of non-matching and matching queries to the trace log and a user defined file. The matched queries are printed with the original and the replacement query.

Comment by Timofey Turenko [ 2015-05-12 ]

how can be logging switched on/off?

Comment by markus makela [ 2015-05-13 ]

Logging to trace can be enabled with log_trace=true|false and logging to file with log_file=PATH.

Here's the relevant documentation: https://github.com/mariadb-corporation/MaxScale/blob/develop/Documentation/filters/Regex-Filter.md#log_file

Comment by Timofey Turenko [ 2015-05-13 ]

works, in the trace log I see:

2015-05-13 15:42:53 [7] No match [Ff][Oo0][rR][mM]: [fetch * from mysql.user;]
2015-05-13 15:42:53 [10] No match [Ff][Oo0][rR][mM]: [show databases;]
2015-05-13 15:50:35 [13] No match [Ff][Oo0][rR][mM]: [select @@version_comment limit 1]
2015-05-13 15:50:38 [13] No match [Ff][Oo0][rR][mM]: [select 1]

Generated at Thu Feb 08 03:56:46 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.