Besoin de journaux sur la base du paramètre de temps dans Unix

Je veux stocker uniquement les journaux qui ont un temps d’exécution inférieur à 20 ms, il y a un fichier énorme pour cette connexion de quelques lignes de journaux pour la même chose. Voulez-vous s’il vous plaît aider.



Message de journal de débogage: Source du message: null Message: {“nom”: “splocal_GetQualityData”, “schéma”: “dbo”, “inputParameters”: {“1”: “628AF1E4-54E4-471E-A5F1-D8C1EF74D7CB”, “2 “:” 743FB2E8-6D63-4F0B-8E03-79799072F4EE “,” 3 “: 1,” 4 “: false},” outputParameters “: null} {} Temps d’exécution: 13 msecs 2018-06-14 00:00:20


debug Journal Message: Source du message: null Message: 30, 2018 4:00:00 “,” IsUserClockedOn “: false,” MaterialDefinitionS95Id “:” 56L1001WC59 “,” LotOPAvailableQty “: 1.0,” TimeZoneName “:” GMT-5 ” , “BatchId”: null, “LotOPStartTime”: “Jan 1, 2100 12:00:00 AM”, “Séquence”: null, “RowNum”: 1, “ScheduledEndDate”: “Jun 21, 2018 4:00:00 AM “,” SortDate “:” 30 mai 2018 12:00:00 AM “,” PriorOpEndTime “:” 13 juin 2018 22:12:15 “,” MaterialLotS95Id “:” V220604 “,” LotStatus “:” En cours “,” IsSerialized “: true},” 2 “: {” LotOperationSegmentResponseId “:” 41E01DE9-B306-4039-B774-46229E700D5A “,” LotOPCompleteQty “: 0.0,” ActiveClockOnCount “: 0,” OrderPriority “: 0, “OrderQty”: 10.0, “LotOPStatus”: “Ready”, “LotSegmentResponseId”: “21C238F0-7F52-459C-AC99-394E347E28EB”, “ShopOrderS95Id”: “HIF1100-006NSUPP3”, “ClockedOnUsers”: null, “Operation”: “7”, “ScheduledStartDate”: “30 mai 2018 4:00:00 2018 4:00:00”, “SortDate”: “Jun 11, 2018 12:00:00 AM”, “PriorOpEndTime”: “Jun 13, 2018 11:52:00 “,” MaterialLotS95Id “:” V240070 “,” LotStatus “:” En cours “,” IsSerialized “: true }} Temps d’exécution: 105 msec 2018-06-14 00:00:21


Message de journal de débogage: Source du message: null Message: {“nom”: “spLocal_GetOperations_ByOperationId”, “schéma”: “dbo”, “inputParameters”: {“1”: “88AD5E8A-D63E-4F4B-AC66-CFE039275F73”, “2 “:” 8A42EB09-1765-49AD-ADA4-5E9614645522 “,” 3 “:” \ u003c? Xml 16, 2018 4:00:00 “,” SortDate “:” Apr 24, 2018 12:00:00 AM ” , “ScheduledStartDate”: “24 avril 2018 4:00:00”, “IsUserClockedOn”: false, “MaterialLotS95Id”: “V170069”, “LotStatus”: “Hold”, “MaterialDefinitionS95Id”: “18L0009WH”, “IsSerialized “: true},” 2 “: {” LotOperationSegmentResponseId “:” 1BD13FF3-A802-4C59-A23B-0CCDCA6B1149 “,” LotOPAvailableQty “: 1.0,” LotOPCompleteQty “: 0.0,” ActiveClockOnCount “: 0,” OrderPriority “: 3, “OrderQty”: 195.0, “LotOPStatus”: “Hold”, “TimeZoneName”: “GMT-5”, “BatchId”: null, “ShopOrderS95Id”: “HSR200065230L”, “ClockedOnUsers”: null, “Operation”: “30 “,” Séquence “: null,” ScheduledEndDate “:” Jan 31, 2018 5:00:00 AM “,” SortDate “:” Jan 8, 2018 12:00:00 AM “,” ScheduledStartDate “:” 8 janvier, 2018 5:00:00 AM “,” ScheduledStartDate “:” 4 juin 2018 4:00:00 “,” IsUserClockedOn “: false,” Mater ialLotS95Id “:” V230217 “,” LotStatus “:” En cours “,” MaterialDefinitionS95Id “:” 58L105WC60 “,” IsSerialized “: true}} Temps d’exécution: 22 msec 2018-06-14 00:00:21


Vous pouvez utiliser le script ci-dessous:

#!/bin/bash #You can get bash path using 'which bash' command IFS=$'\n' for i in `cat logFile` #You can use while in place of for, while provides better performance do execTime=`echo $i|grep "Execution Time:" | sed 's/^.*: //' | awk '{print $1}'` limitTime=20 if [ "$execTime" -lt "$limitTime" ] #executionTime less than 20ms then echo $i fi done