parse_url()parse_url()

分析绝对 URL string,并返回包含 URL 部分的 dynamic 对象。Parses an absolute URL string and returns a dynamic object contains URL parts.

语法Syntax

parse_url(url)parse_url(url)

参数Arguments

  • url:一个字符串,表示 URL 或 URL 的查询部分。url : A string represents a URL or the query part of the URL.

返回Returns

一个动态类型对象,其中包含以下 URL 组件:Scheme、Host、Port、Path、Username、Password、Query Parameters、Fragment。An object of type dynamic that included the URL components: Scheme, Host, Port, Path, Username, Password, Query Parameters, Fragment.

示例Example

T | extend Result = parse_url("scheme://username:password@host:1234/this/is/a/path?k1=v1&k2=v2#fragment")

将得到以下结果:will result

 {
    "Scheme":"scheme",
    "Host":"host",
    "Port":"1234",
    "Path":"this/is/a/path",
    "Username":"username",
    "Password":"password",
    "Query Parameters":"{"k1":"v1", "k2":"v2"}",
    "Fragment":"fragment"
 }