--- id: urlencode title: urlencode Search Operator sidebar_label: urlencode description: Use the urlencode operator to encode URLs into ASCII character set format, the standard format for sending URLs over the internet. slug: /help/docs/search/search-query-language/search-operators/urlencode/ canonical: https://www.sumologic.com/help/docs/search/search-query-language/search-operators/urlencode/ --- import useBaseUrl from '@docusaurus/useBaseUrl'; The `urlencode` operator encodes the URL into an ASCII character set. This is the standard format in which URLs can be sent over the internet. For example, if your URL looks like this: ``` http://yourmainserver-city55555.org/functions/main.php?gk=Gk45MgHJhEYx8bPYvGfiWS7o3KLdfg90& ``` It will be encoded to: ``` http%3A%2F%2Fyourmainserver-city55555.org%2Ffunctions%2Fmain.php%3Fgk%3DGk45MgHJhEYx8bPYvGfiWS7o3KLdfg90%26 ``` ## Syntax `urlencode() [as ]` `urlencode("") as ` ## Examples ### Encode URLs from PagerDuty logs To encode a URL in your PagerDuty logs, you can run this query: ```sumo _sourceCategory=pagerduty | kv "html_url" as url | urlencode(url) as url ``` The query returns the field `url` encoded: URL encode ### Encode a literal URL string To encode a known URL string directly in a query: ```sumo | urlencode("http://example.com/path?query=hello world") as encoded_url ```