From a3d74eb6321f2c53088a0a89cadf278c8024958d Mon Sep 17 00:00:00 2001 From: Rudi Klein Date: Fri, 24 May 2024 13:17:08 +0200 Subject: [PATCH] fullMessage* to fullAlert* --- wazuh-notify-go/notification/discord.go | 16 ++++++++-------- wazuh-notify-go/services/init.go | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/wazuh-notify-go/notification/discord.go b/wazuh-notify-go/notification/discord.go index ac543a5..dac2995 100644 --- a/wazuh-notify-go/notification/discord.go +++ b/wazuh-notify-go/notification/discord.go @@ -17,16 +17,16 @@ func SendDiscord(params types.Params) { var embedDescription string if slices.Contains(strings.Split(params.FullMessage, ","), "discord") { - fullMessage, _ := json.MarshalIndent(params.WazuhMessage, "", " ") - fullMessageString := strings.ReplaceAll(string(fullMessage), `"`, "") - fullMessageString = strings.ReplaceAll(fullMessageString, "{", "") - fullMessageString = strings.ReplaceAll(fullMessageString, "}", "") - fullMessageString = strings.ReplaceAll(fullMessageString, "[", "") - fullMessageString = strings.ReplaceAll(fullMessageString, "]", "") - fullMessageString = strings.ReplaceAll(fullMessageString, " ,", "") + fullAlert, _ := json.MarshalIndent(params.WazuhMessage, "", " ") + fullAlertString := strings.ReplaceAll(string(fullAlert), `"`, "") + fullAlertString = strings.ReplaceAll(fullAlertString, "{", "") + fullAlertString = strings.ReplaceAll(fullAlertString, "}", "") + fullAlertString = strings.ReplaceAll(fullAlertString, "[", "") + fullAlertString = strings.ReplaceAll(fullAlertString, "]", "") + fullAlertString = strings.ReplaceAll(fullAlertString, " ,", "") embedDescription = "\n\n ```" + - fullMessageString + + fullAlertString + "```\n\n" + "Priority: " + strconv.Itoa(params.Priority) + "\n" + "Tags: " + params.Tags + "\n\n" + diff --git a/wazuh-notify-go/services/init.go b/wazuh-notify-go/services/init.go index 0a39453..707b63a 100644 --- a/wazuh-notify-go/services/init.go +++ b/wazuh-notify-go/services/init.go @@ -60,7 +60,7 @@ func InitNotify() types.Params { log.Log(string(inputParamString)) inputParams.Targets = configParams.Targets - inputParams.FullMessage = configParams.FullMessage + inputParams.FullAlert = configParams.FullAlert inputParams.ExcludedAgents = configParams.ExcludedAgents inputParams.ExcludedRules = configParams.ExcludedRules inputParams.PriorityMaps = configParams.PriorityMaps