I want to parse the mysql slow query logs using logstash and I want to replace modifieddate > '2021-06-08 08:13:48' with some generix text like modifieddate > 'NNNN'
Below is the log sample :
# Time: 2021-06-10T06:30:36.160482Z
# User@Host: mosaicpreprodmysql[mosaicpreprodmysql] @ [10.63.21.201] Id: 2563675
# Query_time: 1.045809 Lock_time: 0.000099 Rows_sent: 1 Rows_examined: 1696142
use tags_test;
SET timestamp=1623306635;
Select t.name as name, t.id as tag_id, t.ownerid as customer_id, tr.resourceid as id, tr.modifieddate as modifieddate, t.isdeleted as is_tag_deleted, tr.isdeleted as is_deleted from tag_resource tr join tag t on t.id = tr.tagid where tr.modifieddate > '2021-06-08 08:13:48' ORDER BY tr.modifieddate;
Thanks for the reply.
Will this get the output as below :
Select t.name as name, t.id as tag_id, t.ownerid as customer_id, tr.resourceid as id, tr.modifieddate as modifieddate, t.isdeleted as is_tag_deleted, tr.isdeleted as is_deleted from tag_resource tr join tag t on t.id = tr.tagid where tr.modifieddate > 'NNNN' ORDER BY tr.modifieddate;
Also are the mutate and filter patterns specific to versions of logstash cause I am tring this with logstash version 7.11.1 but the grok is not working for me
@Badger I managed to parse the logs however the complete config file is not working , the groks I created for each line works fine but when I combine them , it doesn't work, here is the configuration file :
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.