Bewerken

Delen via


parse_urlquery()

Applies to: ✅ Microsoft FabricAzure Data ExplorerAzure MonitorMicrosoft Sentinel

Returns a dynamic object that contains the query parameters.

Deprecated aliases: parseurlquery()

Syntax

parse_urlquery(query)

Learn more about syntax conventions.

Parameters

Name Type Required Description
query string ✔️ The query part of the URL. The format must follow URL query standards (key=value& ...).

Returns

An object of type dynamic that includes the query parameters.

Examples

print Result=parse_urlquery("k1=v1&k2=v2&k3=v3")

Output

Result
{ "Query Parameters":"{"k1":"v1", "k2":"v2", "k3":"v3"}" }

The following example uses a function to extract specific query parameters.

let getQueryParamValue = (querystring: string, param: string) {
    let params = parse_urlquery(querystring);
    tostring(params["Query Parameters"].[param])
};
print UrlQuery = 'view=vs-2019&preserve-view=true'
| extend view = getQueryParamValue(UrlQuery, 'view')
| extend preserve = getQueryParamValue(UrlQuery, 'preserve-view')

Output

UrlQuery view preserve
view=vs-2019&preserve-view=true vs-2019 true