> For the complete documentation index, see [llms.txt](https://docs.bindplane.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bindplane.com/integrations/processors/copy-field.md).

# Copy Field

The Copy Field processor copies the value of one telemetry field to another field on the same record, leaving the source in place. It operates on logs, metrics, or traces, and can copy between attributes, body, and resource locations.

### Supported Telemetry

| Metrics | Logs | Traces |
| ------- | ---- | ------ |
| ✓       | ✓    | ✓      |

Choose Telemetry Type picks one signal per processor instance. Add another instance to handle a second signal.

### Configuration

<figure><img src="/files/XIqjEKBjFizG4daTSSXR" alt="Bindplane docs - Copy Field - image 1"><figcaption></figcaption></figure>

**When to apply**

| Parameter             | Type               | Required | Default   | Description                                                                                         |
| --------------------- | ------------------ | -------- | --------- | --------------------------------------------------------------------------------------------------- |
| Choose Telemetry Type | Telemetry Selector | Yes      | Logs      | The signal this instance runs on: Logs, Metrics, or Traces (one at a time).                         |
| Condition             | OTTL Condition     | No       | *(empty)* | An OTTL condition that must evaluate to true for the copy to apply. Empty applies to all telemetry. |

**Source field**

| Parameter        | Type                             | Required | Default    | Description                                                                                                                                   |
| ---------------- | -------------------------------- | -------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| Copy From        | Enum: Attributes, Body, Resource | Yes      | Attributes | The telemetry field location to copy from.                                                                                                    |
| Attributes Field | OTTL Field                       | No       | *(empty)*  | The attributes field to copy from. Bracket notation for nested fields. Empty copies all attribute fields. Shown when Copy From is Attributes. |
| Body Field       | OTTL Field                       | No       | *(empty)*  | The body field to copy from. Bracket notation for nested fields. Empty copies all body fields. Shown when Copy From is Body.                  |
| Resource Field   | OTTL Field                       | No       | *(empty)*  | The resource field to copy from. Bracket notation for nested fields. Empty copies all resource fields. Shown when Copy From is Resource.      |

**Target field**

| Parameter        | Type                   | Required | Default    | Description                                                                                                                                   |
| ---------------- | ---------------------- | -------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| Copy To          | Enum: Attributes, Body | Yes      | Attributes | The telemetry field location to copy to.                                                                                                      |
| Attributes Field | OTTL Field             | No       | *(empty)*  | The attributes field to copy to. Bracket notation for nested fields. Empty overwrites all attribute fields. Shown when Copy To is Attributes. |
| Body Field       | OTTL Field             | No       | *(empty)*  | The body field to copy to. Bracket notation for nested fields. Empty overwrites all body fields. Shown when Copy To is Body.                  |

**Resource is a source-only location.** Copy To offers Attributes and Body only. Body source and target fields apply to logs; for metrics and traces the copy operates on datapoint and span attributes.

### Examples

#### Copy an entire log body to an attribute

The whole log body is copied to an attribute named `body_nested`. This is useful for destinations that ignore or reshape the body field. Leave the Body Field empty under Copy From to take the entire body.

```yaml
apiVersion: bindplane.observiq.com/v1
kind: Processor
metadata:
  name: copy-body-to-attribute
spec:
  type: copy_field
  parameters:
    - name: telemetry
      value:
        - Logs
    - name: from_base
      value: Body
    - name: from_body
      value: ""
    - name: to_base
      value: Attributes
    - name: to_attributes
      value: body_nested
```

#### Nest a resource field under an attribute using bracket notation

A resource field named `host.name` is copied to an attribute `name` nested under a top-level attribute `host`. Bracket notation builds the nested path on the target. A Condition restricts the copy to records that carry the resource field.

```yaml
apiVersion: bindplane.observiq.com/v1
kind: Processor
metadata:
  name: copy-host-name
spec:
  type: copy_field
  parameters:
    - name: telemetry
      value:
        - Logs
    - name: condition
      value: resource.attributes["host.name"] != nil
    - name: from_base
      value: Resource
    - name: from_resource
      value: attributes["host.name"]
    - name: to_base
      value: Attributes
    - name: to_attributes
      value: host["name"]
```

### Configuration Tips

* Use bracket notation (`field["child"]`) on the target field to build or address nested structures.
* Leaving the source field empty copies the entire base (all attributes, the whole body, or all resource fields); leaving the target field empty overwrites the entire base, so prefer a named target field unless you intend a full overwrite.
* The copy is non-destructive at the source: the original field is retained. Use the Move Field processor instead when the source should be removed.

### Troubleshooting

#### The target field is not populated

Symptoms: after the processor runs, the destination field is missing or empty.

Solutions:

1. Confirm the source field exists on the record and matches the Copy From location and path. A missing source value (`nil`) is skipped.
2. Verify the Condition evaluates to true for the records you expect to copy.

#### The wrong field location is copied

Symptoms: the value comes from a different part of the record than intended.

Solutions:

1. Check that Copy From matches where the value actually lives (Attributes, Body, or Resource), and that the field path uses bracket notation for nested keys.
2. Remember Copy To supports Attributes and Body only; Resource cannot be a target.

### Standalone Processor

```yaml
apiVersion: bindplane.observiq.com/v1
kind: Processor
metadata:
  name: copy-field
spec:
  type: copy_field
  parameters:
    - name: telemetry
      value:
        - Logs
    - name: condition
      value: ""
    - name: from_base
      value: Body
    - name: from_body
      value: ""
    - name: to_base
      value: Attributes
    - name: to_attributes
      value: body_nested
```

### Related Resources

* [Transform Processor — OpenTelemetry Collector Contrib](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/transformprocessor/README.md)

#### Bindplane Resources

* [Move Field](/integrations/processors/move-field.md)
* [Add Fields](/integrations/processors/add-fields.md)
* [Delete Fields](/integrations/processors/delete-fields.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.bindplane.com/integrations/processors/copy-field.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
