URL Parser

이 페이지는 아직 영어로 제공되지 않습니다. 현재 번역 작업을 진행 중입니다.
현재 번역 프로젝트에 대해 궁금한 점이나 의견이 있으시면 언제든지 문의하세요!

Overview

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

Url Processor

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:

{
  "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:

{
  "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.

API

Use the Datadog Log Pipeline API endpoint with the following URL processor JSON payload:

{
  "type": "url-parser",
  "name": "Parse the URL from http.url attribute.",
  "is_enabled": true,
  "sources": ["http.url"],
  "target": "http.url_details"
}
ParameterTypeRequiredDescription
typeStringYesType of the processor.
nameStringNoName of the processor.
is_enabledBooleanNoIf the processor is enabled or not. Default: false.
sourcesArray of stringsNoArray of source attributes. Default: http.url.
targetStringYesName of the parent attribute that contains all the extracted details from the sources. Default: http.url_details.

Further reading

추가적인 유용한 설명서, 링크 및 기사: