fullMessage* to fullAlert*

This commit is contained in:
Rudi klein 2024-05-24 13:17:08 +02:00
parent cd17a8ed07
commit a3d74eb632
2 changed files with 9 additions and 9 deletions

View File

@ -17,16 +17,16 @@ func SendDiscord(params types.Params) {
var embedDescription string var embedDescription string
if slices.Contains(strings.Split(params.FullMessage, ","), "discord") { if slices.Contains(strings.Split(params.FullMessage, ","), "discord") {
fullMessage, _ := json.MarshalIndent(params.WazuhMessage, "", " ") fullAlert, _ := json.MarshalIndent(params.WazuhMessage, "", " ")
fullMessageString := strings.ReplaceAll(string(fullMessage), `"`, "") fullAlertString := strings.ReplaceAll(string(fullAlert), `"`, "")
fullMessageString = strings.ReplaceAll(fullMessageString, "{", "") fullAlertString = strings.ReplaceAll(fullAlertString, "{", "")
fullMessageString = strings.ReplaceAll(fullMessageString, "}", "") fullAlertString = strings.ReplaceAll(fullAlertString, "}", "")
fullMessageString = strings.ReplaceAll(fullMessageString, "[", "") fullAlertString = strings.ReplaceAll(fullAlertString, "[", "")
fullMessageString = strings.ReplaceAll(fullMessageString, "]", "") fullAlertString = strings.ReplaceAll(fullAlertString, "]", "")
fullMessageString = strings.ReplaceAll(fullMessageString, " ,", "") fullAlertString = strings.ReplaceAll(fullAlertString, " ,", "")
embedDescription = "\n\n ```" + embedDescription = "\n\n ```" +
fullMessageString + fullAlertString +
"```\n\n" + "```\n\n" +
"Priority: " + strconv.Itoa(params.Priority) + "\n" + "Priority: " + strconv.Itoa(params.Priority) + "\n" +
"Tags: " + params.Tags + "\n\n" + "Tags: " + params.Tags + "\n\n" +

View File

@ -60,7 +60,7 @@ func InitNotify() types.Params {
log.Log(string(inputParamString)) log.Log(string(inputParamString))
inputParams.Targets = configParams.Targets inputParams.Targets = configParams.Targets
inputParams.FullMessage = configParams.FullMessage inputParams.FullAlert = configParams.FullAlert
inputParams.ExcludedAgents = configParams.ExcludedAgents inputParams.ExcludedAgents = configParams.ExcludedAgents
inputParams.ExcludedRules = configParams.ExcludedRules inputParams.ExcludedRules = configParams.ExcludedRules
inputParams.PriorityMaps = configParams.PriorityMaps inputParams.PriorityMaps = configParams.PriorityMaps