kibana/docs/management/field-formatters/url-formatter.asciidoc
2021-10-07 14:30:32 -04:00

33 lines
1.7 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

You can specify the following types to the `Url` field formatter:
* *Link* — Converts the contents of the field into an URL. You can specify the width and height of the image, while keeping the aspect ratio.
When the image is smaller than the specified parameters, the image is unable to upscale.
* *Image* — Specifies the image directory.
* *Audio* — Specify the audio directory.
To customize URL field formats, use templates. An *URL template* enables you to add values
to a partial URL. To add the contents of the field to a fixed URL, use the `{{value}}` string.
For example, when:
* A field contains a user ID
* A field uses the `Url` field formatter
* The URI template is `http://company.net/profiles?user_id={­{value}­}`
The resulting URL replaces `{{value}}` with the user ID from the field.
The `{{value}}` template string URL-encodes the contents of the field. When a field encoded into a URL contains
non-ASCII characters, the characters are replaced with a `%` character and the appropriate hexadecimal code. For
example, field contents `users/admin` result in the URL template adding `users%2Fadmin`.
When the formatter type is *Image*, the `{{value}}` template string specifies the name of an image at the
specified URI.
When the formatter type is *Audio*, the `{{value}}` template string specifies the name of an audio file at the specified URI.
To pass unescaped values directly to the URL, use the `{{rawValue}}` string.
A *Label template* enables you to specify a text string that appears instead of the raw URL. You can use the
`{{value}}` template string normally in label templates. You can also use the `{{url}}` template string to display
the formatted URL.