Hi Everyone,
I'm stuck at an simple query.
Thing is that we need to send an alert email to administrator if there are more than 3 exception came into process. Exceptions are covered under TransactionStatus key in json.
With below query, I'm able to get the exceptions detail but not aware of that how to send email this output.
GET /_search
{
"_source": {
"includes": [
"timeStamp",
"logF_BusinessProcessName",
"logF_TransactionNumber",
"logF_TransactionField1",
"logF_TransactionField2",
"logF_TransactionField3",
"logF_TransactionField4",
"logF_TransactionField5",
"logF_TransactionField6",
"logF_TransactionField7",
"message"]
},
"query": {
"bool": {
"must": [
{ "match": { "logF_TransactionStatus": "ApplicationException" }},
{ "match": { "processName": "XXXXXXXXXX" }}],
"must_not": [
{ "match": { "level": "Error" }},
{ "match": { "level": "Warn" }}
],
"filter": {
"range": { "timeStamp": { "gte": "now-1h" }}
}
}
}
}