Get watch API

Retrieves a watch by its ID.

Request

GET _watcher/watch/<watch_id>

Prerequisites

  • You must have manage_watcher or monitor_watcher cluster privileges to use this API. For more information, see Security privileges.

Path parameters

<watch_id>

(Required, string) Identifier for the watch.

Examples

The following example gets a watch with my-watch id:

  1. GET _watcher/watch/my_watch

Response:

  1. {
  2. "found": true,
  3. "_id": "my_watch",
  4. "_seq_no": 0,
  5. "_primary_term": 1,
  6. "_version": 1,
  7. "status": {
  8. "version": 1,
  9. "state": {
  10. "active": true,
  11. "timestamp": "2015-05-26T18:21:08.630Z"
  12. },
  13. "actions": {
  14. "test_index": {
  15. "ack": {
  16. "timestamp": "2015-05-26T18:21:08.630Z",
  17. "state": "awaits_successful_execution"
  18. }
  19. }
  20. }
  21. },
  22. "watch": {
  23. "input": {
  24. "simple": {
  25. "payload": {
  26. "send": "yes"
  27. }
  28. }
  29. },
  30. "condition": {
  31. "always": {}
  32. },
  33. "trigger": {
  34. "schedule": {
  35. "hourly": {
  36. "minute": [0, 5]
  37. }
  38. }
  39. },
  40. "actions": {
  41. "test_index": {
  42. "index": {
  43. "index": "test"
  44. }
  45. }
  46. }
  47. }
  48. }

The current status of the watch