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
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" +

View File

@ -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