From dcde9f3080ca936b3ffa0d29749ec1243c4ff51b Mon Sep 17 00:00:00 2001 From: Joe Date: Mon, 7 Jan 2019 08:00:06 -0600 Subject: [PATCH] rules fixing and general beautification --- .gitignore | 1 + .../casRpsLogExtractor.maxPKey.dat | 2 +- logAggregator.js | 4 +- rules/casrpslog.rule.json | 103 +++++++++--------- 4 files changed, 57 insertions(+), 53 deletions(-) diff --git a/.gitignore b/.gitignore index 4162c1c..4ecf564 100644 --- a/.gitignore +++ b/.gitignore @@ -79,3 +79,4 @@ typings/ # DynamoDB Local files .dynamodb/ casRpsLogExtractor/casRpsLogExtractor.config.json +casRpsLogExtractor/casRpsLogExtractor.maxPKey.dat diff --git a/casRpsLogExtractor/casRpsLogExtractor.maxPKey.dat b/casRpsLogExtractor/casRpsLogExtractor.maxPKey.dat index df706b3..ce325f2 100644 --- a/casRpsLogExtractor/casRpsLogExtractor.maxPKey.dat +++ b/casRpsLogExtractor/casRpsLogExtractor.maxPKey.dat @@ -1 +1 @@ -0010000000a87kj9 \ No newline at end of file +0010000000a7p61y \ No newline at end of file diff --git a/logAggregator.js b/logAggregator.js index a0a7e6f..77004d6 100644 --- a/logAggregator.js +++ b/logAggregator.js @@ -42,9 +42,11 @@ const server = micro(async (req, res) => { if (isWhiteListed) { logger.log("debug", "Not Whitelisted: " + miniInput); fs.appendFileSync("./log/skipped.log", miniInput + "\n"); + process.stdout.write("."); } else { - logger.log("info", "Not Whitelisted: " + miniInput); + logger.log("debug", "Not Whitelisted: " + miniInput); fs.appendFileSync("./log/issues.log", miniInput + "\n"); + process.stdout.write("!"); } } diff --git a/rules/casrpslog.rule.json b/rules/casrpslog.rule.json index 47a7281..f3058f1 100644 --- a/rules/casrpslog.rule.json +++ b/rules/casrpslog.rule.json @@ -1,58 +1,59 @@ { "casrpslog":{ "rules":[ - { "_comment":"Module Termination" , "Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^END : module .* terminated without errors/"}, - { "_comment":"Module Start" , "Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^START : module /"}, - { "_comment":"Module Start" , "Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^Module.*executable.*parameters.*started\\./"}, - { "_comment":"Listener Start" , "Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^Starting ServerPortListener for ID /"}, - { "_comment":"Listener End" , "Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^Ending ServerPortListener for.*with ID /"}, - { "_comment":"Listener Start" , "Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^Starting COMPortListener for.*on port /"}, - { "_comment":"Listener End" , "Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^Ending COMPortListener for.*on port /"}, - { "_comment":"Transaction Creation" , "Logic":"-", "Field":"LogText", "Comp":"===", "Value":"Create transaction"}, - { "_comment":"Transaction Creation" , "Logic":"-", "Field":"LogText", "Comp":"===", "Value":"ReorganisationWorker.InitializeForWorkerAPI entered."}, - - { "_comment":"Modules whose Loglevel can be trusted.", - "Logic":"&", "rules":[ - {"Logic":"|", "rules":[ - {"Logic":"-", "Field":"Module", "Comp":"~", "Value":"/^PreVtl/"}, - {"Logic":"-", "Field":"Module", "Comp":"~", "Value":"/^Watchdog$/"}, - {"Logic":"-", "Field":"Module", "Comp":"~", "Value":"/^Reorg/"}, - {"Logic":"-", "Field":"Module", "Comp":"~", "Value":"/^WorkerController$/"}, - {"Logic":"-", "Field":"Module", "Comp":"~", "Value":"/^WorkerControllerHeartbeat$/"}, - {"Logic":"-", "Field":"Module", "Comp":"~", "Value":"/^RecordDeletionWorker$/"}, - {"Logic":"-", "Field":"Module", "Comp":"~", "Value":"/^ReplicationDispatcher$/"}, - {"Logic":"-", "Field":"Module", "Comp":"~", "Value":"/^BpaManagementSyncDispatcher$/"}, - {"Logic":"-", "Field":"Module", "Comp":"~", "Value":"/^OPSDispatcher$/"}, - {"Logic":"-", "Field":"Module", "Comp":"~", "Value":"/^IntegrationWebService$/"}, - {"Logic":"-", "Field":"Module", "Comp":"~", "Value":"/.*Worker$/"} - ]}, - {"Logic":"-", "Field":"Severity", "Comp":"<", "Value":"2"} - ] - }, + { "_comment":"Module Termination" , "Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^END : module .* terminated without errors/"}, + { "_comment":"Module Start" , "Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^START : module /"}, + { "_comment":"Module Start" , "Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^Module.*executable.*parameters.*started\\./"}, + { "_comment":"Listener Start" , "Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^Starting ServerPortListener for ID /"}, + { "_comment":"Listener End" , "Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^Ending ServerPortListener for.*with ID /"}, + { "_comment":"Listener Start" , "Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^Starting COMPortListener for.*on port /"}, + { "_comment":"Listener End" , "Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^Ending COMPortListener for.*on port /"}, + { "_comment":"Transaction Creation" , "Logic":"-", "Field":"LogText", "Comp":"===", "Value":"Create transaction"}, + { "_comment":"SettingDefaultFallback" , "Logic":"-", "Field":"LogText", "Comp":"===", "Value":"A setting value cannot be read. The default value is used."}, + { "Logic":"-", "Field":"LogText", "Comp":"===", "Value":"ReorganisationWorker.InitializeForWorkerAPI entered."}, + + { "_comment":"Modules whose Loglevel can be trusted.", + "Logic":"&", "rules":[ + {"Logic":"|", "rules":[ + {"Logic":"-", "Field":"Module", "Comp":"~", "Value":"/^PreVtl/"}, + {"Logic":"-", "Field":"Module", "Comp":"~", "Value":"/^Watchdog$/"}, + {"Logic":"-", "Field":"Module", "Comp":"~", "Value":"/^Reorg/"}, + {"Logic":"-", "Field":"Module", "Comp":"~", "Value":"/^WorkerController$/"}, + {"Logic":"-", "Field":"Module", "Comp":"~", "Value":"/^WorkerControllerHeartbeat$/"}, + {"Logic":"-", "Field":"Module", "Comp":"~", "Value":"/^RecordDeletionWorker$/"}, + {"Logic":"-", "Field":"Module", "Comp":"~", "Value":"/^ReplicationDispatcher$/"}, + {"Logic":"-", "Field":"Module", "Comp":"~", "Value":"/^BpaManagementSyncDispatcher$/"}, + {"Logic":"-", "Field":"Module", "Comp":"~", "Value":"/^OPSDispatcher$/"}, + {"Logic":"-", "Field":"Module", "Comp":"~", "Value":"/^IntegrationWebService$/"}, + {"Logic":"-", "Field":"Module", "Comp":"~", "Value":"/.*Worker$/"} + ]}, + {"Logic":"-", "Field":"Severity", "Comp":"<", "Value":"2"} + ] + }, - { "_comment":"Application Validation Errors", - "Logic":"&", "rules":[ - {"Logic":"-", "Field":"Module", "Comp":"===", "Value":"CAS 11.0"}, - {"Logic":"|", "rules":[ - {"Logic":"-", "Field":"Severity", "Comp":"<", "Value":"2"}, - {"Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^The promotion or tactic is not allowed to extend past the last day of the year.*/"}, - {"Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^Validation notification!/"}, - {"Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^Entry needed for Id./"}, - {"Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^This period overlaps another period of type/"}, - {"Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^When extraction is used all PPGs need to be extracted. Tactic :/"}, - {"Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^When extraction is used all PPGs need to be extracted. Tactic :/"}, - {"Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^The Sum of the funding sources (.*) is not consistent with the sum of the cost all tactics (.*)/"}, - {"Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^Id must be unique!/"}, - {"Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^The data has been altered by another user. To maintain data consistency please reselect the object and repeat your modifications./"}, - {"Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/.*Please assign a PPG or SKU to the payment request.*/m"}, - {"Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^The tactic .* needs to have at least one included product/"}, - {"Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^You cannot close the tactic, there are payment transactions pending/"}, - {"Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^invalid combination types (Compensation Model \\/ Payment Method \\/ Volume Type) for this Tactic/"}, - {"Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^Based on the template setting 'Evaluate Thresholds' the promotion must be calculated before changing the workflow state. Please recalculate the promotion./"} - ]} - ] - }, + { "_comment":"Application Validation Errors", + "Logic":"&", "rules":[ + {"Logic":"-", "Field":"Module", "Comp":"===", "Value":"CAS 11.0"}, + {"Logic":"|", "rules":[ + {"Logic":"-", "Field":"Severity", "Comp":"<", "Value":"2"}, + {"Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^The promotion or tactic is not allowed to extend past the last day of the year.*/"}, + {"Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^Validation notification!/"}, + {"Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^Entry needed for Id./"}, + {"Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^This period overlaps another period of type/"}, + {"Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^When extraction is used all PPGs need to be extracted. Tactic :/"}, + {"Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^When extraction is used all PPGs need to be extracted. Tactic :/"}, + {"Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^The Sum of the funding sources (.*) is not consistent with the sum of the cost all tactics (.*)/"}, + {"Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^Id must be unique!/"}, + {"Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^The data has been altered by another user. To maintain data consistency please reselect the object and repeat your modifications./"}, + {"Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/.*Please assign a PPG or SKU to the payment request.*/m"}, + {"Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^The tactic .* needs to have at least one included product/"}, + {"Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^You cannot close the tactic, there are payment transactions pending/"}, + {"Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^invalid combination types (Compensation Model \\/ Payment Method \\/ Volume Type) for this Tactic/"}, + {"Logic":"-", "Field":"LogText", "Comp":"~", "Value":"/^Based on the template setting 'Evaluate Thresholds' the promotion must be calculated before changing the workflow state. Please recalculate the promotion./"} + ]} + ] + }, - {"_comment":"MyRecalcAccrual Rules", + {"_comment":"MyRecalcAccrual Rules", "Logic":"&", "rules":[ {"Logic":"-", "Field":"Module", "Comp":"===", "Value":"MyRecalcAccrual"}, {"Logic":"|", "rules":[