Cryo21

Watcher Results

Oct 10th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 7.10 KB | None | 0 0
  1. {
  2.   "watch_id": "_inlined_",
  3.   "state": "executed",
  4.   "status": {
  5.     "state": {
  6.       "active": true,
  7.       "timestamp": "2017-10-10T16:57:13.174Z"
  8.     },
  9.     "last_checked": "2017-10-10T16:57:13.174Z",
  10.     "last_met_condition": "2017-10-10T16:57:13.174Z",
  11.     "actions": {
  12.       "send_email": {
  13.         "ack": {
  14.           "timestamp": "2017-10-10T16:57:13.174Z",
  15.           "state": "ackable"
  16.         },
  17.         "last_execution": {
  18.           "timestamp": "2017-10-10T16:57:13.174Z",
  19.           "successful": true
  20.         },
  21.         "last_successful_execution": {
  22.           "timestamp": "2017-10-10T16:57:13.174Z",
  23.           "successful": true
  24.         }
  25.       }
  26.     }
  27.   },
  28.   "trigger_event": {
  29.     "type": "manual",
  30.     "triggered_time": "2017-10-10T16:57:13.174Z",
  31.     "manual": {
  32.       "schedule": {
  33.         "scheduled_time": "2017-10-10T16:57:13.174Z"
  34.       }
  35.     }
  36.   },
  37.   "input": {
  38.     "search": {
  39.       "request": {
  40.         "search_type": "dfs_query_then_fetch",
  41.         "indices": [
  42.           "<filebeat-{now/d}>"
  43.         ],
  44.         "types": [],
  45.         "body": {
  46.           "query": {
  47.             "bool": {
  48.               "must": [
  49.                 {
  50.                   "query_string": {
  51.                     "query": "NOT remote_ip:**IP ADDRESS**\\/24 OR NOT remote_ip:**IP ADDRESS**\\/24 OR NOT remote_ip:**IP ADDRESS**\\/16 OR NOT remote_ip:**IP ADDRESS**\\/24 OR NOT remote_ip:**IP ADDRESS**",
  52.                     "analyze_wildcard": true
  53.                   }
  54.                 },
  55.                 {
  56.                   "range": {
  57.                     "@timestamp": {
  58.                       "gte": "now-60s"
  59.                     }
  60.                   }
  61.                 }
  62.               ],
  63.               "must_not": []
  64.             }
  65.           },
  66.           "size": 0,
  67.           "aggs": {
  68.             "2": {
  69.               "terms": {
  70.                 "field": "remote_ip",
  71.                 "order": {
  72.                   "_count": "desc"
  73.                 }
  74.               },
  75.               "aggs": {
  76.                 "3": {
  77.                   "sum": {
  78.                     "field": "bytes"
  79.                   }
  80.                 }
  81.               }
  82.             }
  83.           }
  84.         }
  85.       }
  86.     }
  87.   },
  88.   "condition": {
  89.     "compare": {
  90.       "ctx.payload.aggregations.2.buckets.3.3.value": {
  91.         "gt": "10000"
  92.       }
  93.     }
  94.   },
  95.   "result": {
  96.     "execution_time": "2017-10-10T16:57:13.174Z",
  97.     "execution_duration": 32,
  98.     "input": {
  99.       "type": "search",
  100.       "status": "success",
  101.       "payload": {
  102.         "_shards": {
  103.           "total": 5,
  104.           "failed": 0,
  105.           "successful": 5,
  106.           "skipped": 0
  107.         },
  108.         "hits": {
  109.           "hits": [],
  110.           "total": 869,
  111.           "max_score": 0
  112.         },
  113.         "took": 30,
  114.         "timed_out": false,
  115.         "aggregations": {
  116.           "2": {
  117.             "doc_count_error_upper_bound": 12,
  118.             "sum_other_doc_count": 489,
  119.             "buckets": [
  120.               {
  121.                 "3": {
  122.                   "value": 432991
  123.                 },
  124.                 "doc_count": 57,
  125.                 "key": "**IP ADDRESS**"
  126.               },
  127.               {
  128.                 "3": {
  129.                   "value": 74919
  130.                 },
  131.                 "doc_count": 45,
  132.                 "key": "**IP ADDRESS**"
  133.               },
  134.               {
  135.                 "3": {
  136.                   "value": 169269
  137.                 },
  138.                 "doc_count": 45,
  139.                 "key": "**IP ADDRESS**"
  140.               },
  141.               {
  142.                 "3": {
  143.                   "value": 1562306
  144.                 },
  145.                 "doc_count": 42,
  146.                 "key": "**IP ADDRESS**"
  147.               },
  148.               {
  149.                 "3": {
  150.                   "value": 384091
  151.                 },
  152.                 "doc_count": 40,
  153.                 "key": "**IP ADDRESS**"
  154.               },
  155.               {
  156.                 "3": {
  157.                   "value": 258564
  158.                 },
  159.                 "doc_count": 38,
  160.                 "key": "**IP ADDRESS**"
  161.               },
  162.               {
  163.                 "3": {
  164.                   "value": 127922
  165.                 },
  166.                 "doc_count": 33,
  167.                 "key": "**IP ADDRESS**"
  168.               },
  169.               {
  170.                 "3": {
  171.                   "value": 292779
  172.                 },
  173.                 "doc_count": 33,
  174.                 "key": "**IP ADDRESS**"
  175.               },
  176.               {
  177.                 "3": {
  178.                   "value": 126337
  179.                 },
  180.                 "doc_count": 24,
  181.                 "key": "**IP ADDRESS**"
  182.               },
  183.               {
  184.                 "3": {
  185.                   "value": 118073
  186.                 },
  187.                 "doc_count": 23,
  188.                 "key": "**IP ADDRESS**"
  189.               }
  190.             ]
  191.           }
  192.         }
  193.       },
  194.       "search": {
  195.         "request": {
  196.           "search_type": "dfs_query_then_fetch",
  197.           "indices": [
  198.             "<filebeat-{now/d}>"
  199.           ],
  200.           "types": [],
  201.           "body": {
  202.             "query": {
  203.               "bool": {
  204.                 "must": [
  205.                   {
  206.                     "query_string": {
  207.                       "query": "NOT remote_ip:**IP ADDRESS**\\/24 OR NOT remote_ip:**IP ADDRESS**\\/24 OR NOT remote_ip:**IP ADDRESS**\\/16 OR NOT remote_ip:**IP ADDRESS**\\/24 OR NOT remote_ip:**IP ADDRESS**",
  208.                       "analyze_wildcard": true
  209.                     }
  210.                   },
  211.                   {
  212.                     "range": {
  213.                       "@timestamp": {
  214.                         "gte": "now-60s"
  215.                       }
  216.                     }
  217.                   }
  218.                 ],
  219.                 "must_not": []
  220.               }
  221.             },
  222.             "size": 0,
  223.             "aggs": {
  224.               "2": {
  225.                 "terms": {
  226.                   "field": "remote_ip",
  227.                   "order": {
  228.                     "_count": "desc"
  229.                   }
  230.                 },
  231.                 "aggs": {
  232.                   "3": {
  233.                     "sum": {
  234.                       "field": "bytes"
  235.                     }
  236.                   }
  237.                 }
  238.               }
  239.             }
  240.           }
  241.         }
  242.       }
  243.     },
  244.     "condition": {
  245.       "type": "compare",
  246.       "status": "success",
  247.       "met": true,
  248.       "compare": {
  249.         "resolved_values": {
  250.           "ctx.payload.aggregations.2.buckets.3.3.value": 1562306
  251.         }
  252.       }
  253.     },
  254.     "actions": [
  255.       {
  256.         "id": "send_email",
  257.         "type": "email",
  258.         "status": "simulated",
  259.         "email": {
  260.           "message": {
  261.             "id": "_inlined__2ea51f76-2808-4d82-901c-102024563d9c-2017-10-10T16:57:13.174Z",
  262.             "sent_date": "2017-10-10T16:57:13.206Z",
  263.             "to": [
  264.               "**EMAIL ADDRESS**"
  265.             ],
  266.             "subject": "Watcher Test Alert",
  267.             "body": {
  268.               "text": "The IP [**IP ADDRESS** ] spiked useage with [1562306.0 ]"
  269.             }
  270.           }
  271.         }
  272.       }
  273.     ]
  274.   },
  275.   "messages": []
  276. }
Add Comment
Please, Sign In to add comment