---
title: URL Parser
description: Extract query parameters and other important parameters from a URL
breadcrumbs: Docs > Log Management > Log Configuration > Processors > URL Parser
---

# URL Parser

## Overview{% #overview %}

The URL parser processor extracts query parameters and other important parameters from a URL. When set up, the following attributes are produced:

{% image
   source="https://docs.dd-static.net/images/logs/processing/processors/url_processor.a1170ed0086a36a18af3a229fc9bfe5d.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/logs/processing/processors/url_processor.a1170ed0086a36a18af3a229fc9bfe5d.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt="Url Processor" /%}

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

The URL Parser is used to extract useful information from a URL, for example, logs coming from nginx can contain URLs that are automatically parsed to extract filters, queries, and sources.

## Before and after state of logs{% #before-and-after-state-of-logs %}

{% collapsible-section %}
#### Example: Parsing a URL in custom application logs

**Before:**

```json
{
  "client": {
    "ip": "10.12.4.20"
  },
  "http": {
    "method": "GET",
    "url": "https://api.example.com/v1/orders?user_id=12345&limit=20",
    "status_code": 200
  },
  "timestamp": 1696945536000
}
```

**URL Parser**

Create a URL Parser processor and configure it to parse the `http.url` attribute. The processor extracts the URL into multiple structured attributes (scheme, host, path, or query parameters).

**After processing:**

```json
{
  "client": {
    "ip": "10.12.4.20"
  },
  "http": {
    "method": "GET",
    "url": "https://api.example.com/v1/orders?user_id=12345&limit=20",
    "url_details": {
      "host": "api.example.com",
      "path": "/v1/orders",
      "port": 443,
      "queryString": {
        "user_id": "12345",
        "limit": "20"
      },
      "scheme": "https"
    },
    "status_code": 200
  },
  "timestamp": 1696945536000
}
```

The URL Parser automatically adds a new nested attribute (http.url_details) containing extracted components of the URL.
{% /collapsible-section %}

## API{% #api %}

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

```json
{
  "type": "url-parser",
  "name": "Parse the URL from http.url attribute.",
  "is_enabled": true,
  "sources": ["http.url"],
  "target": "http.url_details"
}
```

| Parameter    | Type             | Required | Description                                                                                                           |
| ------------ | ---------------- | -------- | --------------------------------------------------------------------------------------------------------------------- |
| `type`       | String           | Yes      | Type of the processor.                                                                                                |
| `name`       | String           | No       | Name of the processor.                                                                                                |
| `is_enabled` | Boolean          | No       | If the processor is enabled or not. Default: `false`.                                                                 |
| `sources`    | Array of strings | No       | Array of source attributes. Default: `http.url`.                                                                      |
| `target`     | String           | Yes      | Name of the parent attribute that contains all the extracted details from the `sources`. Default: `http.url_details`. |

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

- [Discover Datadog Pipelines](https://docs.datadoghq.com/logs/log_configuration/pipelines.md)
