---
title: Span Remapper
description: Define a log attribute as its associated span ID
breadcrumbs: Docs > Log Management > Log Configuration > Processors > Span Remapper
---

# Span Remapper

## Overview{% #overview %}

There are two ways to define correlation between application spans and logs:

1. Follow the documentation on [how to inject a Span ID in the application logs](https://docs.datadoghq.com/tracing/other_telemetry/connect_logs_and_traces.md). Log integrations automatically handle all remaining setup steps by default.

1. Use the span remapper processor to define a log attribute as its associated span ID.

## Use cases{% #use-cases %}

The Span Remapper is typically used to select the Span Id that is within a log message that needs first to be parsed with a Grok Parser.

## API{% #api %}

Use the [Datadog Log Pipeline API endpoint](https://docs.datadoghq.com/api/v1/logs-pipelines.md) with the following span remapper JSON payload:

```json
{
  "type": "span-id-remapper",
  "name": "Define dd.span_id as the official span id associated with this log",
  "is_enabled": true,
  "sources": ["dd.span_id"]
}
```

| Parameter    | Type             | Required | Description                                                   |
| ------------ | ---------------- | -------- | ------------------------------------------------------------- |
| `type`       | String           | Yes      | Type of the processor.                                        |
| `name`       | String           | No       | Name of the processor.                                        |
| `is_enabled` | Boolean          | No       | Indicates whether the processor is enabled. Default: `false`. |
| `sources`    | Array of strings | No       | Array of source attributes. Default: `dd.span_id`.            |

**Note**: Trace IDs and span IDs are not displayed in your logs or log attributes in the UI.

## Further reading{% #further-reading %}

- [Discover Datadog Pipelines](https://docs.datadoghq.com/logs/log_configuration/pipelines.md)
- [Connect logs and traces](https://docs.datadoghq.com/tracing/other_telemetry/connect_logs_and_traces.md)
