github.com/vieux/docker@v0.6.3-0.20161004191708-e097c2a938c7/docs/admin/formatting.md (about) 1 <!--[metadata]> 2 +++ 3 title = "Format command and log output" 4 description = "CLI and log output formatting reference" 5 keywords = ["format, formatting, output, templates, log"] 6 [menu.main] 7 parent = "engine_admin" 8 weight=7 9 +++ 10 <![end-metadata]--> 11 12 # Formatting reference 13 14 Docker uses [Go templates](https://golang.org/pkg/text/template/) to allow users manipulate the output format 15 of certain commands and log drivers. Each command a driver provides a detailed 16 list of elements they support in their templates: 17 18 - [Docker Images formatting](../reference/commandline/images.md#formatting) 19 - [Docker Inspect formatting](../reference/commandline/inspect.md#examples) 20 - [Docker Log Tag formatting](logging/log_tags.md) 21 - [Docker Network Inspect formatting](../reference/commandline/network_inspect.md) 22 - [Docker PS formatting](../reference/commandline/ps.md#formatting) 23 - [Docker Stats formatting](../reference/commandline/stats.md#formatting) 24 - [Docker Volume Inspect formatting](../reference/commandline/volume_inspect.md) 25 - [Docker Version formatting](../reference/commandline/version.md#examples) 26 27 ## Template functions 28 29 Docker provides a set of basic functions to manipulate template elements. 30 This is the complete list of the available functions with examples: 31 32 ### Join 33 34 Join concatenates a list of strings to create a single string. 35 It puts a separator between each element in the list. 36 37 $ docker ps --format '{{join .Names " or "}}' 38 39 ### Json 40 41 Json encodes an element as a json string. 42 43 $ docker inspect --format '{{json .Mounts}}' container 44 45 ### Lower 46 47 Lower turns a string into its lower case representation. 48 49 $ docker inspect --format "{{lower .Name}}" container 50 51 ### Split 52 53 Split slices a string into a list of strings separated by a separator. 54 55 # docker inspect --format '{{split (join .Names "/") "/"}}' container 56 57 ### Title 58 59 Title capitalizes a string. 60 61 $ docker inspect --format "{{title .Name}}" container 62 63 ### Upper 64 65 Upper turms a string into its upper case representation. 66 67 $ docker inspect --format "{{upper .Name}}" container