> ## Documentation Index
> Fetch the complete documentation index at: https://docs.honeycomb.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Coalesce

<Badge className="hny-badge-enterprise-addon" stroke>Ent+</Badge>

<Note>
  This feature is available as an add-on for the [Honeycomb Enterprise plan](https://www.honeycomb.io/pricing/).
  Please contact your Honeycomb account team for details.
</Note>

## Description

The Coalesce processor can be used to consolidate many field names into a single field name.

## Use

The Coalesce processor is utilized for consolidating telemetry fields in metrics, logs, and traces based on specified conditions.

<Note>
  While this is similar on concept to SQL Coalesce, it has some key differences. Especially around the order of precedence. See the behavior section.
</Note>

## Supported Types

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

## Configuration

| Field           | Description                                                           |
| :-------------- | :-------------------------------------------------------------------- |
| Telemetry Types | The types of telemetry to apply the processor to.                     |
| Condition       | A condition that determines when this processor is applied.           |
| Action          | The action to take (insert, update, upsert) when coalescing telemetry |
| Coalesce From   | The telemetry fields to coalesce from.                                |
| Coalesce To     | The telemetry field to coalesce to.                                   |

## Behavior

The behavior of this processor is dependent on the selected action.

When insert is selected, the target field only gets coalesced to if it doesn't exist. Precedence: First item in list.
When update is selected, the target field gets coalesced to only if it already exists. Precedence: Last item in list.
When upsert it selected, the target field gets coalesces to regardless whether it existed or not. Precedence: Last item in list.

## Example Configuration(s)

### Coalesce timestamp fields

This configuration will coalesce the body fields `ts`, `time`, and `timestamp` to an attribute named `time` for later parsing. Upsert is used for the action.

#### Web Interface

<img src="https://mintcdn.com/honeycomb/Vy1afIK7iWSWQCHo/_assets/images/htp/coalesce-timestamp.png?fit=max&auto=format&n=Vy1afIK7iWSWQCHo&q=85&s=340e4e4f60125b06a972b930990bf2d1" alt="Honeycomb Docs - Coalesce Field - Timestamps" width="864" height="799" data-path="_assets/images/htp/coalesce-timestamp.png" />

### Coalesce severity fields

This configuration will coalesce the body fields `sev`, `severity`, and `level` to an attribute named `severity` for later parsing. Upsert is used for the action.

#### Web Interface

<img src="https://mintcdn.com/honeycomb/Vy1afIK7iWSWQCHo/_assets/images/htp/coalesce-severity.png?fit=max&auto=format&n=Vy1afIK7iWSWQCHo&q=85&s=041a5d9f84bfce94167f76b4479c1407" alt="Honeycomb Docs - Coalesce Field - Severity" width="862" height="787" data-path="_assets/images/htp/coalesce-severity.png" />

### Coalesce datacenter fields

This configuration will coalesce the body fields `dc`, `datacenter`, and `location` to an attribute named `datacenter` for later parsing. Upsert is used for the action.

#### Web Interface

<img src="https://mintcdn.com/honeycomb/Vy1afIK7iWSWQCHo/_assets/images/htp/coalesce-datacenter.png?fit=max&auto=format&n=Vy1afIK7iWSWQCHo&q=85&s=755e5051dbd1db350d3963f2251d939a" alt="Honeycomb Docs - Coalesce Field - Datacenter" width="862" height="782" data-path="_assets/images/htp/coalesce-datacenter.png" />
