Get rollup jobs API

Retrieves the configuration, stats, and status of rollup jobs.

This functionality is experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features.

Request

GET _rollup/job/<job_id>

Prerequisites

  • If the Elasticsearch security features are enabled, you must have monitor, monitor_rollup, manage or manage_rollup cluster privileges to use this API. For more information, see Security privileges.

Description

The API can return the details for a single rollup job or for all rollup jobs.

This API returns only active (both STARTED and STOPPED) jobs. If a job was created, ran for a while then deleted, this API does not return any details about that job.

For details about a historical rollup job, the rollup capabilities API may be more useful.

Path parameters

<job_id>

(Optional, string) Identifier for the rollup job. If it is _all or omitted, the API returns all rollup jobs.

Response body

jobs

(array) An array of rollup job resources.

Properties of rollup job resources

  • config

    (object) Contains the configuration for the rollup job. This information is identical to the configuration that was supplied when creating the job via the create job API.

    stats

    (object) Contains transient statistics about the rollup job, such as how many documents have been processed and how many rollup summary docs have been indexed. These stats are not persisted. If a node is restarted, these stats are reset.

    status

    (object) Contains the current status of the indexer for the rollup job. The possible values and their meanings are:

    • stopped means the indexer is paused and will not process data, even if its cron interval triggers.
    • started means the indexer is running, but not actively indexing data. When the cron interval triggers, the job’s indexer will begin to process data.
    • indexing means the indexer is actively processing data and creating new rollup documents. When in this state, any subsequent cron interval triggers will be ignored because the job is already active with the prior trigger.
    • abort is a transient state, which is usually not witnessed by the user. It is used if the task needs to be shut down for some reason (job has been deleted, an unrecoverable error has been encountered, etc). Shortly after the abort state is set, the job will remove itself from the cluster.

Examples

If we have already created a rollup job named sensor, the details about the job can be retrieved with:

  1. GET _rollup/job/sensor

The API yields the following response:

  1. {
  2. "jobs": [
  3. {
  4. "config": {
  5. "id": "sensor",
  6. "index_pattern": "sensor-*",
  7. "rollup_index": "sensor_rollup",
  8. "cron": "*/30 * * * * ?",
  9. "groups": {
  10. "date_histogram": {
  11. "fixed_interval": "1h",
  12. "delay": "7d",
  13. "field": "timestamp",
  14. "time_zone": "UTC"
  15. },
  16. "terms": {
  17. "fields": [
  18. "node"
  19. ]
  20. }
  21. },
  22. "metrics": [
  23. {
  24. "field": "temperature",
  25. "metrics": [
  26. "min",
  27. "max",
  28. "sum"
  29. ]
  30. },
  31. {
  32. "field": "voltage",
  33. "metrics": [
  34. "avg"
  35. ]
  36. }
  37. ],
  38. "timeout": "20s",
  39. "page_size": 1000
  40. },
  41. "status": {
  42. "job_state": "stopped",
  43. "upgraded_doc_id": true
  44. },
  45. "stats": {
  46. "pages_processed": 0,
  47. "documents_processed": 0,
  48. "rollups_indexed": 0,
  49. "trigger_count": 0,
  50. "index_failures": 0,
  51. "index_time_in_ms": 0,
  52. "index_total": 0,
  53. "search_failures": 0,
  54. "search_time_in_ms": 0,
  55. "search_total": 0,
  56. "processing_time_in_ms": 0,
  57. "processing_total": 0
  58. }
  59. }
  60. ]
  61. }

The jobs array contains a single job (id: sensor) since we requested a single job in the endpoint’s URL. If we add another job, we can see how multi-job responses are handled:

  1. PUT _rollup/job/sensor2
  2. {
  3. "index_pattern": "sensor-*",
  4. "rollup_index": "sensor_rollup",
  5. "cron": "*/30 * * * * ?",
  6. "page_size": 1000,
  7. "groups": {
  8. "date_histogram": {
  9. "field": "timestamp",
  10. "fixed_interval": "1h",
  11. "delay": "7d"
  12. },
  13. "terms": {
  14. "fields": [ "node" ]
  15. }
  16. },
  17. "metrics": [
  18. {
  19. "field": "temperature",
  20. "metrics": [ "min", "max", "sum" ]
  21. },
  22. {
  23. "field": "voltage",
  24. "metrics": [ "avg" ]
  25. }
  26. ]
  27. }
  28. GET _rollup/job/_all

We create a second job with name sensor2

Then request all jobs by using _all in the GetJobs API

Which will yield the following response:

  1. {
  2. "jobs": [
  3. {
  4. "config": {
  5. "id": "sensor2",
  6. "index_pattern": "sensor-*",
  7. "rollup_index": "sensor_rollup",
  8. "cron": "*/30 * * * * ?",
  9. "groups": {
  10. "date_histogram": {
  11. "fixed_interval": "1h",
  12. "delay": "7d",
  13. "field": "timestamp",
  14. "time_zone": "UTC"
  15. },
  16. "terms": {
  17. "fields": [
  18. "node"
  19. ]
  20. }
  21. },
  22. "metrics": [
  23. {
  24. "field": "temperature",
  25. "metrics": [
  26. "min",
  27. "max",
  28. "sum"
  29. ]
  30. },
  31. {
  32. "field": "voltage",
  33. "metrics": [
  34. "avg"
  35. ]
  36. }
  37. ],
  38. "timeout": "20s",
  39. "page_size": 1000
  40. },
  41. "status": {
  42. "job_state": "stopped",
  43. "upgraded_doc_id": true
  44. },
  45. "stats": {
  46. "pages_processed": 0,
  47. "documents_processed": 0,
  48. "rollups_indexed": 0,
  49. "trigger_count": 0,
  50. "index_failures": 0,
  51. "index_time_in_ms": 0,
  52. "index_total": 0,
  53. "search_failures": 0,
  54. "search_time_in_ms": 0,
  55. "search_total": 0,
  56. "processing_time_in_ms": 0,
  57. "processing_total": 0
  58. }
  59. },
  60. {
  61. "config": {
  62. "id": "sensor",
  63. "index_pattern": "sensor-*",
  64. "rollup_index": "sensor_rollup",
  65. "cron": "*/30 * * * * ?",
  66. "groups": {
  67. "date_histogram": {
  68. "fixed_interval": "1h",
  69. "delay": "7d",
  70. "field": "timestamp",
  71. "time_zone": "UTC"
  72. },
  73. "terms": {
  74. "fields": [
  75. "node"
  76. ]
  77. }
  78. },
  79. "metrics": [
  80. {
  81. "field": "temperature",
  82. "metrics": [
  83. "min",
  84. "max",
  85. "sum"
  86. ]
  87. },
  88. {
  89. "field": "voltage",
  90. "metrics": [
  91. "avg"
  92. ]
  93. }
  94. ],
  95. "timeout": "20s",
  96. "page_size": 1000
  97. },
  98. "status": {
  99. "job_state": "stopped",
  100. "upgraded_doc_id": true
  101. },
  102. "stats": {
  103. "pages_processed": 0,
  104. "documents_processed": 0,
  105. "rollups_indexed": 0,
  106. "trigger_count": 0,
  107. "index_failures": 0,
  108. "index_time_in_ms": 0,
  109. "index_total": 0,
  110. "search_failures": 0,
  111. "search_time_in_ms": 0,
  112. "search_total": 0,
  113. "processing_time_in_ms": 0,
  114. "processing_total": 0
  115. }
  116. }
  117. ]
  118. }