-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample
More file actions
37 lines (36 loc) · 915 Bytes
/
example
File metadata and controls
37 lines (36 loc) · 915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# watcher-elastic
curl -XPUT 'http://localhost:9200/_watcher/watch/log_error_petruk' -d '{
"trigger" : {
"schedule" : { "interval" : "30s" }
},
"input" : {
"search" : {
"request" : {
"indices" : [ "logs" ],
"body" : {
"query": {
"query_string": {
"query":"_type: premium_celery_beat",
"analyze_wildcard": true
}
}
}
}
}
},
"actions": {
"send_trigger": {
"webhook": {
"method": "POST",
"scheme": "https",
"port": 443,
"host": "hooks.slack.com",
"path": "/services/XXXXXX/XXXXXX/XXXXXXXXXXXXX",
"body": "{ \"text\": \"encountered {{ctx.payload.hits.total}} errors in past 30 second \"}",
"headers": {
"Content-type": "application/json"
}
}
}
}
}'