Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 1.79 KB | None | 0 0
  1. {
  2.    "trigger":{
  3.       "schedule":{
  4.          "interval":"1m"
  5.       }
  6.    },
  7.    "input":{
  8.       "search":{
  9.          "request":{
  10.             "search_type":"query_then_fetch",
  11.             "indices":[
  12.                "iburgerzaken-blueriq-*"
  13.             ],
  14.             "rest_total_hits_as_int":true,
  15.             "body":{
  16.                "query":{
  17.                   "bool":{
  18.                      "filter":[
  19.                         {
  20.                            "range":{
  21.                               "@timestamp":{
  22.                                  "from":"now-1m",
  23.                                  "to":"now"
  24.                               }
  25.                            }
  26.                         }
  27.                      ]
  28.                   },
  29.                   "match":{
  30.                      "message":{
  31.                         "query":"Invalid date format pattern 'DD-MM-YYYY'"
  32.                      }
  33.                   }
  34.                }
  35.             }
  36.          }
  37.       }
  38.    },
  39.    "condition":{
  40.       "compare":{
  41.          "ctx.payload.hits.total.value":{
  42.             "gt":0
  43.          }
  44.       }
  45.    },
  46.    "actions":{
  47.       "email_administrator":{
  48.          "email":{
  49.             "profile":"standard",
  50.             "attachments":{
  51.                "attached_data":{
  52.                   "data":{
  53.                      "format":"json"
  54.                   }
  55.                }
  56.             },
  57.             "priority":"high",
  58.             "to":[
  59.                "email@email.com"
  60.             ],
  61.             "subject":"Error: Invalid date format pattern 'DD-MM-YYYY' has occured {{ctx.payload.hits.total.value}} times",
  62.             "body":{
  63.                "text":"Alert for error: Invalid date format pattern 'DD-MM-YYYY'. See attached data for in depth information"
  64.             }
  65.          }
  66.       }
  67.    }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement