url_encode_component()

Applies to: ✅ Azure Data ExplorerAzure MonitorMicrosoft Sentinel

The function converts characters of the input URL into a format that can be transmitted over the internet. Differs from url_encode by encoding spaces as '%20' and not as '+'.

Syntax

url_encode_component(url)

Learn more about syntax conventions.

Parameters

Name Type Required Description
url string ✔️ The URL to encode.

Returns

URL (string) converted into a format that can be transmitted over the Internet.

Example

let url = @'https://www.bing.com/hello world/';
print original = url, encoded = url_encode_component(url)

Output

original encoded
https://www.bing.com/hello world/ https%3a%2f%2fwww.bing.com%2fhello%20world