From be7c65ebfd2a7b67b9f1ddb485e82feed8f8a45b Mon Sep 17 00:00:00 2001 From: stefink Date: Mon, 20 Jun 2022 15:54:13 +0530 Subject: [PATCH] AK-8868 Added parser for log message --- src/integrations/parser.go | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/integrations/parser.go b/src/integrations/parser.go index 15a0a6a..c997dd0 100644 --- a/src/integrations/parser.go +++ b/src/integrations/parser.go @@ -1,9 +1,21 @@ package integrations +import ( + "encoding/json" + "time" +) + type Log struct { - date string + DataDomainID string `json:"DataDomainID"` + Database string `json:"Database"` + Operation string `json:"Operation"` + OperationDetails string `json:"OperationDetails"` + Timestamp time.Time `json:"Timestamp"` + User string `json:"User"` } -func ParseLog(log string) Log { - panic("UnImplemented!") +func ParseLog(logdata string) Log { + log := Log{} + json.Unmarshal([]byte(logdata), &log) + return log }