# ansible.builtin.urlsplit
get components from URL

## Parameter
| Parameter | Type                                                                                                        | Description                           |
| --------- | ----------------------------------------------------------------------------------------------------------- | ------------------------------------- |
| **query** | "fragment"<br>"hostname"<br>"netloc"<br>"password"<br>"path"<br>"port"<br>"query"<br>"scheme"<br>"username" | Specify a single component to return. |

## Examples
```yaml
parts: '{{ "http://user:password@www.acme.com:9000/dir/index.html?query=term#fragment" | urlsplit }}'
# =>
#   {
#       "fragment": "fragment",
#       "hostname": "www.acme.com",
#       "netloc": "user:password@www.acme.com:9000",
#       "password": "password",
#       "path": "/dir/index.html",
#       "port": 9000,
#       "query": "query=term",
#       "scheme": "http",
#       "username": "user"
#   }

hostname: '{{ "http://user:password@www.acme.com:9000/dir/index.html?query=term#fragment" | urlsplit("hostname") }}'
# => 'www.acme.com'

query: '{{ "http://user:password@www.acme.com:9000/dir/index.html?query=term#fragment" | urlsplit("query") }}'
# => 'query=term'

path: '{{ "http://user:password@www.acme.com:9000/dir/index.html?query=term#fragment" | urlsplit("path") }}'
# => '/dir/index.html'
```