[MXS-4551] qlafilter with options=extended does not log query nor date Created: 2023-03-08  Updated: 2023-05-04  Resolved: 2023-05-02

Status: Closed
Project: MariaDB MaxScale
Component/s: qlafilter
Affects Version/s: 6.4.5, 22.08.4
Fix Version/s: 6.4.7

Type: Bug Priority: Minor
Reporter: Alain Thivillon Assignee: markus makela
Resolution: Fixed Votes: 0
Labels: None
Environment:

Linux Debian 11 bullseye, Ubuntu 22


Issue Links:
Relates
relates to MXS-4602 Qlafilter logs responses from non-mat... Closed
Sprint: MXS-SPRINT-180, MXS-SPRINT-181

 Description   

When using qlafilter with the following conf :

 
[log_query]
type=filter
module=qlafilter
filebase=/var/log/maxscale/query
match=/.*/
separator=";"
newline_replacement=" NL "
options=ignorecase,extended
log_type=unified
log_data=date,service,default_db,user,query,total_reply_time,num_rows,error_msg
flush=true

the following sample output is written to /var/log/maxscale/query.unified :

dns_service;;user_pdns2@::ffff:192.168.119.35;;pdnsfbx;-2147483648;3;
dns_service;;user_pdns2@::ffff:192.168.119.35;;pdnsfbx;-2147483648;6;
dns_service;;user_pdns2@::ffff:192.168.119.35;;pdnsfbx;-2147483648;4;
dns_service;;user_pdns2@::ffff:192.168.119.35;;pdnsfbx;-2147483648;3;
dns_service;;user_pdns2@::ffff:192.168.119.35;;pdnsfbx;-2147483648;6;
dns_service;;user_pdns2@::ffff:192.168.119.35;;pdnsfbx;-2147483648;10;
dns_service;;user_pdns2@::ffff:192.168.119.35;;pdnsfbx;-2147483648;2;
dns_service;;user_pdns2@::ffff:192.168.119.35;;pdnsfbx;-2147483648;3;

Please not that query and date are replaced by an empty string, and total_reply_time is wrong (-2^31).

After removing options=extended, everything is fine :

 
dns_service;2023-03-08 13:52:11;user_pdns2@::ffff:192.168.119.35;show databases;pdnsfbx;1;3;
dns_service;2023-03-08 13:52:11;user_pdns2@::ffff:192.168.119.35;show tables;pdnsfbx;0;6;
dns_service;2023-03-08 13:52:11;user_pdns2@::ffff:192.168.119.35;show tables;pdnsfbx;14;4;
dns_service;2023-03-08 13:52:11;user_pdns2@::ffff:192.168.119.35;show tables;pdnsfbx;27;3;
dns_service;2023-03-08 13:52:11;user_pdns2@::ffff:192.168.119.35;show tables;pdnsfbx;40;6;
dns_service;2023-03-08 13:52:11;user_pdns2@::ffff:192.168.119.35;show tables;pdnsfbx;53;10;
dns_service;2023-03-08 13:52:11;user_pdns2@::ffff:192.168.119.35;show tables;pdnsfbx;66;2;
dns_service;2023-03-08 13:52:11;user_pdns2@::ffff:192.168.119.35;show tables;pdnsfbx;79;3;

Tested with Maxscale 6.4.5 and 22.04 installed from official repo on Ubuntu 22.04.02 and Debian 11
(amd64).

"Extended" is not what i was thinking (using PCRE instead of regular Posix regexp) so this is not important for our setup, but maybe this can be useful for somebody

Thanks anyway.


Generated at Thu Feb 08 04:29:27 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.