Récupérer les logs slowquery RDS ayant pris plus de d’une seconde

Log

Field	Value
@ingestionTime	1678208087115
@log	405371933703:/aws/rds/cluster/prod-main/slowquery
@logStream	prod-main-instance-v3-1
@message	
# Time: 2023-03-07T16:54:45.040552Z
# User@Host: eurovia-ro[eurovia-ro] @  [10.0.25.124]  Id: 2621277
# Query_time: 1.585929  Lock_time: 0.000186 Rows_sent: 16189  Rows_examined: 80945
use eurovia;
SET timestamp=1678208085;
SELECT 
	`u`.`id` AS u_0_id_0,
	`u`.`user_id` AS u_0_user_id_1,
	asset_id AS u_0_AssetID_2,
	`u`.`statut` AS u_0_statut_3,
	`u`.`commentaire` AS u_0_commentaire_4,
	`u`.`actif` AS u_0_actif_5,
	`u`.`indispoType_id` AS u_0_indispoType_id_6,
	`u`.`chantier_id` AS u_0_chantier_id_7,
	`u`.`date_debut` AS u_0_date_debut_9,
	`u`.`date_fin` AS u_0_date_fin_10,
	`u`.`timezone` AS u_0_timezone_11,
	`u`.`time_unit` AS u_0_time_unit_12,
	`u`.`start_time` AS u_0_start_time_13,
	`u`.`end_time` AS u_0_end_time_14,
	`u`.`ref` AS u_0_ref_15,
	`u`.`date_creation` AS u_0_date_creation_16,
	`u`.`updated_at` AS u_0_updated_at_17 FROM `indispo` AS u LEFT JOIN materiel          mi ON (u.materiel_id = mi.id) LEFT JOIN mat_externe       me ON (u.materielExt_id = me.id) LEFT JOIN personnel         pi ON (u.personnel_id = pi.id) LEFT JOIN personnel_externe pe ON (u.personnelExterne_id = pe.id) WHERE asset_id IN (638562,155251,371047,623832,724368,512026,631375,153216,721096,145962,249150,313071,739636,643231,402102,246009,647112,272143,684693,728510,645549,717203,638564,607417,504271,631376,439226,439228,152672,155017,227359,544788,185012,619019,155614,622500,185058,453863,663332,614544,227364,721471,623122,246029,250988,671741,611944,739621,158572,593572,638563,552991,213790,721473,730714,472945,697399,656630,677119,185063,544932,205386,730650,227647,609398,205509,275685,227414,643232,684712,608301,246008,643230,643254,662770,622999,155065,724667,110754,234787,117405,116261,111252,275358,108141,106175,123998,116086,108361,106326,108649,106070,631663,108232,109360,111671,117050,116520,111455,117453,111292,698484,106150,107886,149010,745187,106421,108230,741145,727020,412732,108231,420204,110794,148968,420045,111856,720712,71468,108873,116518,104631,110582,119424,112357,106370,113390,106568,116113,108223,112176,107580,113943,106513,106086,698474,108359,419870,106281,111840,117210,106508,108453,113368,105263,114354,119276,122608,107615,724447,106468,738192,116013,106453,106509,265564,596113,111926,706299,106105,114772,119637,111038,106104,734227,108226,108225,114842,118032,111118,115810,116521,104282,112046,688387,108229,741056,112131,108224,112036,116236,106506,106192,117699,113230,122602,119335,106309,357706,106403,112372,118322,115841,595364,106518,277642,108360,110250,116368,106184,115606,106156,110693,110987,738245,123148,268284,116792,469135,112219,106186,134286,134530,483596,134334,483595,134531,134281,134221,134343,293792,134284,134528,483559,345564,134223,134285,134335,134336,134340,483597,134333,293789,134352,182971,134365,399267,134354,658283,293793,670568,583104,134330,134551,134339,134337,134367,134323,134322,134529,134279,134542,134353,134301,134304,134302,134539,134096,134289,134550,134356,134357,134318,134319,691617,134556,134332,449260,134331,134324,280054,134321,134329,134338,134348,134540,317097,317098,134325,134327,384434,134549,134364,134358,134328,134114,134552,134346,390438,134225,134296,134290,134351,134342,134350,134359,134355,134287,134226,134228,134341,182987,134537,134349,134295,483565,134227,134347,293796,483599,705750,483600,705751,134288,134300,134293,134298,134291,134297,134536,134299,134538,134294,134292,134231,134545,134282,134280,134222,134546,134361,134320,341608,134283,134344,134533,134224,134345,134362,134112,134317,134230,134316,483438,134532,280242,134305,134541,390715,134306,134363,134113,134308,134366,134543,134303,134548,134547,182959,134315,134360,134307,134309,134310,182972,134229,134312,182970,134314,182969,182984,134544,182985,182973,182960,182986,134313,134311);
@timestamp	1678208085040

Requête

fields @timestamp, @message, @logStream, @log
| sort @timestamp desc
| limit 20
| parse @message "# Query_time: * Lock_time" as Query_time
| filter abs(Query_time) > 1

Maitrise :

EC2

Infra 3 tiers :