Monitoring Message create table when sending email alert?

Hello,
I am trying to send an alert using monitoring feature, but in the message section under monitor>trigger, is there a way I can format the results into table and send email?

for example,
i want it to look like
|API|Total|Success|Fail


|A | 25 |22 | 3


|B | 30 | 30 | 0

something like this, but doesnt take \t for indent or html to format them into table to look pretty.

is thete such feature?

Thank you!

Hi @yyhk123 ,

What you’re after can be achieved using an aggregation alert type, you can use the following sample using an extraction type alert.

{
  "size": 0,
  "aggs": {
    "api_name_agg": {
      "terms": {
        "field": "valueA.keyword",
        "size": 10
      },
      "aggs": {
        "total_requests": {
          "value_count": {
            "field": "valueB.keyword"
          }
        }
      }
    }
  }
}

You can then add more values if needed.

Then use a trigger based on where you’re sending the result.

But an example be for slack you can use a handlebar approach to achieve what you’re after.

Leeroy.