---
type: api
title: Get rollup job information
description: **All methods and paths for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/operation/operation-rollup-get-jobs
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/operation/operation-rollup-get-jobs
products:
  - Elasticsearch
---

# Get rollup job information


deprecated

Availability: 6.3+

## Paths

- `GET` `/_rollup/job/{id}`
- `GET` `/_rollup/job`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/authentication#basicauth)
- [Bearer auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/authentication#bearerauth)

#### Path Parameters

- `id` (string Id) — optional, leave it out to use `/_rollup/job`
  Identifier for the rollup job.
If it is `_all` or omitted, the API returns all rollup jobs.

## Description

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

NOTE: This API returns only active (both `STARTED` and `STOPPED`) jobs.
If a job was created, ran for a while, then was deleted, the API does not return any details about it.
For details about a historical rollup job, the rollup capabilities API may be more useful.

## Required authorization

* Cluster privileges: `monitor_rollup`

## Response

`application/json`

- `jobs` ([] RollupJob)
  - `config` ({} RollupJobConfiguration)
    The rollup job configuration.
    - `cron` (string)
    - `groups` ({} Groupings)
      - `date_histogram` ({} DateHistogramGrouping)
        A date histogram group aggregates a date field into time-based buckets.
This group is mandatory; you currently cannot roll up documents without a timestamp and a `date_histogram` group.
        - `delay` (string Duration)
          How long to wait before rolling up new documents.
By default, the indexer attempts to roll up all data that is available.
However, it is not uncommon for data to arrive out of order.
The indexer is unable to deal with data that arrives after a time-span has been rolled up.
You need to specify a delay that matches the longest period of time you expect out-of-order data to arrive.
        - `field` (string Field)
          The date field that is to be rolled up.
        - `format` (string)
        - `interval` (string Duration)
        - `calendar_interval` (string Duration)
          The interval of time buckets to be generated when rolling up.
        - `fixed_interval` (string Duration)
          The interval of time buckets to be generated when rolling up.
        - `time_zone` (string)
          Defines what `time_zone` the rollup documents are stored as.
Unlike raw data, which can shift timezones on the fly, rolled documents have to be stored with a specific timezone.
By default, rollup documents are stored in `UTC`.
      - `histogram` ({} HistogramGrouping)
        The histogram group aggregates one or more numeric fields into numeric histogram intervals.
        - `fields` (string Fields)
          The set of fields that you wish to build histograms for.
All fields specified must be some kind of numeric.
Order does not matter.
        - `interval` (number)
          The interval of histogram buckets to be generated when rolling up.
For example, a value of `5` creates buckets that are five units wide (`0-5`, `5-10`, etc).
Note that only one interval can be specified in the histogram group, meaning that all fields being grouped via the histogram must share the same interval.
      - `terms` ({} TermsGrouping)
        The terms group can be used on keyword or numeric fields to allow bucketing via the terms aggregation at a later point.
The indexer enumerates and stores all values of a field for each time-period.
This can be potentially costly for high-cardinality groups such as IP addresses, especially if the time-bucket is particularly sparse.
        - `fields` (string Fields)
          The set of fields that you wish to collect terms for.
This array can contain fields that are both keyword and numerics.
Order does not matter.
    - `id` (string Id)
    - `index_pattern` (string)
    - `metrics` ([] FieldMetric)
      - `field` (string Field)
        The field to collect metrics for. This must be a numeric of some kind.
      - `metrics` ([] enum Metric)
        An array of metrics to collect for the field. At least one metric must be configured.
        Values: `min`, `max`, `sum`, `avg`, `value_count`
    - `page_size` (number)
    - `rollup_index` (string IndexName)
    - `timeout` (string Duration)
  - `stats` ({} RollupJobStats)
    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.
    - `documents_processed` (number)
    - `index_failures` (number)
    - `index_time_in_ms` (DurationValueUnitMillis)
    - `index_total` (number)
    - `pages_processed` (number)
    - `rollups_indexed` (number)
    - `search_failures` (number)
    - `search_time_in_ms` (DurationValueUnitMillis)
    - `search_total` (number)
    - `trigger_count` (number)
    - `processing_time_in_ms` (DurationValueUnitMillis)
    - `processing_total` (number)
  - `status` ({} RollupJobStatus)
    The current status of the indexer for the rollup job.
    - `current_position` (map string to object)
    - `job_state` (enum IndexingJobState)
      Values: `started`, `indexing`, `stopping`, `stopped`, `aborting`
    - `upgraded_doc_id` (boolean)
## Code Examples

#### Console

```console
GET _rollup/job/sensor
```

#### JavaScript

```javascript
const response = await client.rollup.getJobs({
  id: "sensor",
});
```

#### Python

```python
resp = client.rollup.get_jobs(
    id="sensor",
)
```

#### curl

```curl
curl -X GET "$ELASTICSEARCH_URL/_rollup/job/sensor" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.rollup().getJobs(g -> g
    .id("sensor")
);
```

#### C#

```c#
var response = await client.Rollup
    .GetJobsAsync(d1 => d1
        .Id("sensor")
    );
```

#### PHP

```php
$resp = $client->rollup()->getJobs([
    "id" => "sensor",
]);
```

#### Ruby

```ruby
response = client.perform_request(
  "GET",
  "/_rollup/job/sensor",
  {},
)
```

## Response Examples

#### Get rollup job response example1

A successful response from `GET _rollup/job/sensor`.

```json
{
  "jobs": [
    {
      "config": {
        "id": "sensor",
        "index_pattern": "sensor-*",
        "rollup_index": "sensor_rollup",
        "cron": "*/30 * * * * ?",
        "groups": {
          "date_histogram": {
            "fixed_interval": "1h",
            "delay": "7d",
            "field": "timestamp",
            "time_zone": "UTC"
          },
          "terms": {
            "fields": [
              "node"
            ]
          }
        },
        "metrics": [
          {
            "field": "temperature",
            "metrics": [
              "min",
              "max",
              "sum"
            ]
          },
          {
            "field": "voltage",
            "metrics": [
              "avg"
            ]
          }
        ],
        "timeout": "20s",
        "page_size": 1000
      },
      "status": {
        "job_state": "stopped"
      },
      "stats": {
        "pages_processed": 0,
        "documents_processed": 0,
        "rollups_indexed": 0,
        "trigger_count": 0,
        "index_failures": 0,
        "index_time_in_ms": 0,
        "index_total": 0,
        "search_failures": 0,
        "search_time_in_ms": 0,
        "search_total": 0,
        "processing_time_in_ms": 0,
        "processing_total": 0
      }
    }
  ]
}
```

