# archive

> For the complete documentation index, see [llms.txt](https://docs.redpanda.com/llms.txt). Component-specific: [connect-full.txt](https://docs.redpanda.com/connect-full.txt)

---
title: archive
latest-connect-version: 4.117.0
latest-operator-version: v26.2.6
latest-console-tag: v3.14.0
latest-redpanda-tag: v26.2.6
docname: processors/archive
page-component-name: connect
page-version: master
page-component-version: master
page-component-title: Connect
page-relative-src-path: processors/archive.adoc
page-edit-url: https://github.com/redpanda-data/rp-connect-docs/edit/main/modules/components/pages/processors/archive.adoc
description: Archives all the messages of a batch into a single message according to the selected archive format.
page-git-created-date: "2024-05-24"
page-git-modified-date: "2026-10-29"
page-generated-sources:
  - include: connect:components:partial$descriptions/processors/archive.adoc
    generator: null
    version: null
    source: the component specs in https://github.com/redpanda-data/connect
  - include: connect:components:partial$availability/processors/archive.adoc
    generator: null
    version: null
    source: the component specs in https://github.com/redpanda-data/connect
  - include: connect:components:partial$fields/processors/archive.adoc
    generator: null
    version: null
    source: the component specs in https://github.com/redpanda-data/connect
  - include: connect:components:partial$examples/processors/archive.adoc
    generator: null
    version: null
    source: the component specs in https://github.com/redpanda-data/connect
page-generated-content: partial
---

<!-- Source: https://docs.redpanda.com/connect/components/processors/archive.md -->

Archives all the messages of a batch into a single message according to the selected archive format.

Some archive formats (such as tar, zip) treat each archive item (message part) as a file with a path. Since message parts only contain raw data a unique path must be generated for each part. This can be done by using function interpolations on the 'path' field as described in [Bloblang queries](https://docs.redpanda.com/connect/configuration/interpolation/#bloblang-queries). For types that aren’t file based (such as binary) the file field is ignored.

The resulting archived message adopts the metadata of the _first_ message part of the batch.

The functionality of this processor depends on being applied across messages that are batched. You can find out more about batching [in this doc](https://docs.redpanda.com/connect/configuration/batching/).

To reverse this process use the [`unarchive` processor](https://docs.redpanda.com/connect/components/processors/unarchive/) followed by a [`split` processor](https://docs.redpanda.com/connect/components/processors/split/) to process each message individually.

#### Common

```yml
processor:
  label: ""
  archive:
    format: "" # No default (required)
    path: ""
```

#### Advanced

```yml
processor:
  label: ""
  archive:
    format: "" # No default (required)
    path: ""
```

## [](#fields)Fields

### [](#format)`format`

The archiving format to apply.

**Type**: `string`

| Option | Summary |
| --- | --- |
| binary | Archive messages to a binary blob format. |
| concatenate | Join the raw contents of each message into a single binary message. |
| json_array | Attempt to parse each message as a JSON document and append the result to an array, which becomes the contents of the resulting message. |
| lines | Join the raw contents of each message and insert a line break between each one. |
| tar | Archive messages to a unix standard tape archive. |
| zip | Archive messages to a zip file. |

### [](#path)`path`

The path to set for each message in the archive (when applicable).

This field supports [interpolation functions](https://docs.redpanda.com/connect/configuration/interpolation/#bloblang-queries).

**Type**: `string`

**Default**: `""`

```yaml
# Examples:
path: ${!counter()}-${!timestamp_unix_nano()}.txt

# ---

path: ${!meta("kafka_key")}-${!json("id")}.json
```

## [](#examples)Examples

### [](#tar-archive)Tar Archive

If we had JSON messages in a batch each of the form:

```json
{"doc":{"id":"foo","body":"hello world 1"}}
```

And we wished to tar archive them, setting their filenames to their respective unique IDs (with the extension `.json`), our config might look like this:

```yaml
pipeline:
  processors:
    - archive:
        format: tar
        path: ${!json("doc.id")}.json
```