X-Pack Watcher Email Action Formatting Question

Hi all,

I have the below watcher set up to email me when a specific condition it met. It emails the results related to what was found in the body of an email.

The problem I have is it sends it as a raw JSON file in the body of the email.

My question is, is there a way to format this nicer, i.e. maybe HTML so it is user friendly content embedded in the email that is sent?

{
  "trigger": {
    "schedule": {
      "interval": "30m"
    }
  },
  "input": {
    "search": {
      "request": {
        "search_type": "query_then_fetch",
        "indices": [
          "providence_doc*"
        ],
        "types": [],
        "body": {
          "query": {
            "bool": {
              "must": [
                {
                  "match": {
                    "entity": "Cyber Security Monitoring"
                  }
                },
                {
                  "query_string": {
                    "query": "\"DDoS\" AND \"currently\" OR \"experiencing\"",
                    "analyze_wildcard": true,
                    "default_field": "*"
                  }
                }
              ]
            }
          }
        }
      }
    }
  },
  "condition": {
    "compare": {
      "ctx.payload.hits.total": {
        "gt": 0
      }
    }
  },
  "actions": {
    "send_email": {
      "email": {
        "profile": "standard",
        "to": [
          "name@worldstack.net"
        ],
        "subject": "Current DDoS Attacks",
        "body": {
          "text": "{{#toJson}}ctx.payload{{/toJson}}"
        }
      }
    }
  }
}

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.