# HTTP header extractor enrichment
> Extract HTTP request headers using regex patterns and attach them to events as entities.
> Source: https://docs.snowplow.io/docs/pipeline/enrichments/available-enrichments/http-header-extractor-enrichment/
> Documentation index: https://docs.snowplow.io/llms.txt

This enrichment can extract name/value pairs from the HTTP headers in the tracker request to the Collector, and attach them to the event as entities.

## Configuration

The enrichment takes one parameter:

| Parameter        | Required | Description                   |
| ---------------- | -------- | ----------------------------- |
| `headersPattern` | ✅        | A regex for matching headers. |

**Console:**

Configure the parameters in the Console enrichment editor. For example:

```json
{
  "headersPattern": ".*"
}
```

**Self-Hosted:**

For Self-Hosted, [provide a complete JSON](/docs/pipeline/enrichments/managing-enrichments/terraform/). For example:

```json
{
  "schema": "iglu:com.snowplowanalytics.snowplow.enrichments/http_header_extractor_config/jsonschema/1-0-0",
  "data": {
    "vendor": "com.snowplowanalytics.snowplow.enrichments",
    "name": "http_header_extractor_config",
    "enabled": false,
    "parameters": {
      "headersPattern": ".*"
    }
  }
}
```

***

> **Tip: Testing with Micro**
>
> Unsure if your enrichment configuration is correct or works as expected? You can easily test it using [Snowplow Micro](/docs/testing/snowplow-micro/), either [through Console](/docs/testing/snowplow-micro/console/) or [on your machine](/docs/testing/snowplow-micro/local/).

All the headers that will match the regular expression defined in `headersPattern` parameter will be attached to the event.

In the example configuration, all the headers of the request would be attached to the event because of the `.*` regular expression pattern.

If you're only interested in the host, for example, use:

```json
      "headersPattern": "(?i)Host"
```

## Output

For **each** header matching the regex defined in `headersPattern`, an `http_header` entity is added to the enriched event. Each entity contains only one name/value pair.

### `http_header`

**Type:** Entity

Schema for a single HTTP header

**Properties:**

| Property         | Description |
| ---------------- | ----------- |
| `name` _string_  | _Required._ |
| `value` _string_ | _Required._ |
