# Coalesce

### 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.

{% hint style="info" %}
**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.
{% endhint %}

### Supported Types

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

### Configuration

<table><thead><tr><th width="156.99609375">Field</th><th>Description</th></tr></thead><tbody><tr><td>Telemetry Types</td><td>The types of telemetry to apply the processor to.</td></tr><tr><td>Condition</td><td>A condition that determines when this processor is applied.</td></tr><tr><td>Action</td><td>The action to take (insert, update, upsert) when coalescing telemetry</td></tr><tr><td>Coalesce From</td><td>The telemetry fields to coalesce from.</td></tr><tr><td>Coalesce To</td><td>The telemetry field to coalesce to.</td></tr></tbody></table>

### 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**

<figure><img src="https://1405008107-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgmiOMzBfoNFwmKJFHMcJ%2Fuploads%2Fgit-blob-3b79b0c0c7fd955a45d7e8acdb79e390b4878e7e%2Fintegrations-processors-coalesce-image-1.png?alt=media" alt="Bindplane docs - Coalesce - image 1"><figcaption></figcaption></figure>

#### 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**

<figure><img src="https://1405008107-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgmiOMzBfoNFwmKJFHMcJ%2Fuploads%2Fgit-blob-52d95f1065cb42b1c81799cfb00e8eeafc7ea7d1%2Fintegrations-processors-coalesce-image-2.png?alt=media" alt="Bindplane docs - Coalesce - image 2"><figcaption></figcaption></figure>

#### 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**

<figure><img src="https://1405008107-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgmiOMzBfoNFwmKJFHMcJ%2Fuploads%2Fgit-blob-66b3bd3ba9589126ddbc0d9b6cd6e19c36ed110a%2Fintegrations-processors-coalesce-image-3.png?alt=media" alt="Bindplane docs - Coalesce - image 3"><figcaption></figcaption></figure>


---

# Agent Instructions: 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:

```
GET https://docs.bindplane.com/integrations/processors/coalesce.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
