Shape · Text
URL Parse
Splits a web address into its parts: scheme, host, port, path, query and fragment. For example, pull the domain out of referrer links.
Also known as: Extract domain
How it works
Pick the URL column; the Output prefix defaults to the column name plus an underscore. Six columns are appended: scheme, host, port, path, query and fragment, each null when that part is absent. A value that is not a URL (it contains whitespace, or has a port outside 0 to 65535) gives null in every part and the node reports how many such rows it saw. Percent-encoding is kept as written, and host:port without a scheme is read as an authority when the host is localhost or contains a dot, such as example.com:8080. A parsed column whose name the input already has replaces that column, so re-running on the output does not duplicate columns.
Inputs and outputs
Inputs
data— Table
Outputs
data— Table
Settings
The Attributes panel of URL Parse, as in the app: the controls work, but nothing runs — there is no data behind it.
The same settings, as the Assistant writes them
{
column: string
prefix?: string
}— appends <prefix>scheme/host/port/path/query/fragment; prefix defaults to "<column>_"
Example
Web analytics rows carry a referrer column and you want traffic by domain. Parse referrer with the default prefix and group by referrer_host.
| referrer | referrer_scheme | referrer_host | referrer_path |
|---|---|---|---|
| https://example.com/docs?x=1 | https | example.com | /docs |
| not a url | NULL | NULL | NULL |