> 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/rewrite-timestamp/rewrite-timestamp-deprecated.md).

# Rewrite Timestamp (Deprecated)

{% hint style="info" %}
**NOTE**

This processor has been deprecated and replaced with a new [Rewrite Timestamp](/integrations/processors/rewrite-timestamp.md) processor. While it will continue to function, it will no longer receive enhancements and you should migrate to the new processor.
{% endhint %}

Reads the timestamp from a record's time field, formats it as a string using a ctime layout, and writes that string into a target field you choose. This is the inverse of parsing: where Parse Timestamp reads a string and sets the record's time field, Rewrite Timestamp takes the existing time field and renders it back out as a formatted string.

### Supported Telemetry Types

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

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

### Configuration

#### Basic Configuration

<figure><img src="/files/jjzTfw2lYw0dVSaEj7gI" alt="Bindplane docs - Rewrite Timestamp - 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)* | Rewrite only the records that match. Empty runs on every record.            |

**Target field**

| Parameter         | Type                   | Required | Default             | Description                                                                                                                   |
| ----------------- | ---------------------- | -------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| Target Field Type | Enum: Attributes, Body | Yes      | Attributes          | Where the formatted timestamp string is written. **Body is logs-only.** For Metrics and Traces, only Attributes is available. |
| Target Field      | OTTL Field             | Yes      | *(empty)*           | The field in which to store the formatted timestamp string.                                                                   |
| Timestamp Format  | String                 | Yes      | `%b %e %Y %H:%M:%S` | The ctime layout used to format the timestamp (for example `Jun 18 2026 14:30:00`).                                           |

### Examples

#### Render a parsed timestamp back into a string attribute

A common pattern is to parse a raw log line, extract its timestamp into the record's time field, and then write that time back out as a formatted string. After Parse Timestamp has populated the time field, add Rewrite Timestamp for Logs with Target Field Type `Attributes`, Target Field `new_ts`, and a ctime format such as `%Y-%m-%d %H:%M:%S`.

For a record whose time field holds `2026-06-18T14:30:00Z`, the processor adds an attribute:

```
attributes:
  new_ts: "2026-06-18 14:30:00"
```

The original time field is left unchanged; only the new string field is added.

### Configuration Tips

* Timestamp Format uses ctime directives, not Go layout strings. See the layout reference linked below for the supported directives.
* Rewrite Timestamp does not change the record's time field. It only writes a formatted string copy to the target field.
* Body as a target field type is available for Logs only. Metrics and Traces can only write the result to Attributes.

### Troubleshooting

#### The target field is empty or missing

Symptoms: no formatted timestamp string appears at the target field after the processor runs.

Solutions:

1. Confirm the record's time field is actually set. Rewrite Timestamp formats the existing time field, so an unset time produces no useful result.
2. Verify the Condition evaluates true for the records you expect to rewrite.

#### The formatted string looks wrong

Symptoms: the output string is in an unexpected format.

Solutions:

1. Check the Timestamp Format against the supported ctime directives. A mismatched directive renders unexpected output.

### Standalone Processor

```yaml
apiVersion: bindplane.observiq.com/v1
kind: Processor
metadata:
  name: rewrite-timestamp
spec:
  type: rewrite-timestamp
  parameters:
    - name: telemetry_types
      value: Logs
    - name: log_condition
      value: ""
    - name: log_target_field_type
      value: Attributes
    - name: log_target_field
      value: new_ts
    - name: log_timestamp_format
      value: "%Y-%m-%d %H:%M:%S"
```

### Related Resources

* [FormatTime — OTTL function reference](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/pkg/ottl/ottlfuncs#FormatTime)
* [Supported ctime layout directives](https://docs.bindplane.com/how-to-guides/ctime-formatting)

### Bindplane Resources

* [Parse Timestamp](/integrations/processors/parse-timestamp.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/rewrite-timestamp/rewrite-timestamp-deprecated.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.
