parse_urlquery function parses a URL query string and returns a dynamic object containing the query parameters as key-value pairs. Use this function to extract and analyze query parameters from URLs in logs, API requests, or web traffic data.
For users of other query languages
If you come from other query languages, this section explains how to adjust your existing queries to achieve the same results in APL.Splunk SPL users
Splunk SPL users
In Splunk SPL, you use
rex or URL parsing to extract query parameters. APL’s parse_urlquery provides structured query string parsing.ANSI SQL users
ANSI SQL users
In ANSI SQL, query string parsing requires complex string manipulation. APL’s
parse_urlquery provides native parsing.Usage
Syntax
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| query_string | string | Yes | A URL query string (with or without the leading ’?’) to parse. |
Returns
Returns a dynamic object containing the query parameters as key-value pairs.Use case examples
- Log analysis
- OpenTelemetry traces
- Security logs
Extract and analyze query parameters from API requests to understand search patterns and filter usage.QueryRun in PlaygroundOutput
This query parses query parameters from API requests to analyze pagination and sorting preferences.
| page | limit | sort | request_count |
|---|---|---|---|
| 1 | 50 | date | 8765 |
List of related functions
- parse_url: Parses complete URLs into all components. Use this when you need more than just query parameters.
- url_decode: Decodes URL-encoded strings. Use this to decode individual query parameter values.
- split: Splits strings by delimiters. Use this for simpler query string tokenization without key-value parsing.
- parse_json: Parses JSON strings. Use this when working with JSON data rather than URL query strings.