Skip to main content

HTTP header extractor enrichment

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:

ParameterRequiredDescription
headersPatternA regex for matching headers.

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

json
{
"headersPattern": ".*"
}
Testing with Micro

Unsure if your enrichment configuration is correct or works as expected? You can easily test it using Snowplow Micro, either through Console or on your machine.

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

Entity
Schema for a single HTTP header
Schema URIiglu:org.ietf/http_header/jsonschema/1-0-0
Example data
json
{
"name": "Accept-Language",
"value": "en-US,en;q=0.9"
}
Properties and schema
PropertyDescription
name
string
Required.
value
string
Required.

On this page

Want to see a custom demo?

Our technical experts are here to help.