1
- ---
2
- description : CLI and log output formatting reference
3
- keywords :
4
- - format, formatting, output, templates, log
5
- menu :
6
- main :
7
- parent : engine_admin
8
- weight : 7
9
- title : Format command and log output
10
- ---
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
11
12
12
# Formatting reference
13
13
@@ -20,6 +20,7 @@ list of elements they support in their templates:
20
20
- [ Docker Log Tag formatting] ( logging/log_tags.md )
21
21
- [ Docker Network Inspect formatting] ( ../reference/commandline/network_inspect.md )
22
22
- [ Docker PS formatting] ( ../reference/commandline/ps.md#formatting )
23
+ - [ Docker Stats formatting] ( ../reference/commandline/stats.md#formatting )
23
24
- [ Docker Volume Inspect formatting] ( ../reference/commandline/volume_inspect.md )
24
25
- [ Docker Version formatting] ( ../reference/commandline/version.md#examples )
25
26
@@ -33,46 +34,34 @@ This is the complete list of the available functions with examples:
33
34
Join concatenates a list of strings to create a single string.
34
35
It puts a separator between each element in the list.
35
36
36
- {% raw %}
37
37
$ docker ps --format '{{join .Names " or "}}'
38
- {% endraw %}
39
38
40
39
### Json
41
40
42
41
Json encodes an element as a json string.
43
42
44
- {% raw %}
45
43
$ docker inspect --format '{{json .Mounts}}' container
46
- {% endraw %}
47
44
48
45
### Lower
49
46
50
47
Lower turns a string into its lower case representation.
51
48
52
- {% raw %}
53
49
$ docker inspect --format "{{lower .Name}}" container
54
- {% endraw %}
55
50
56
51
### Split
57
52
58
53
Split slices a string into a list of strings separated by a separator.
59
54
60
- {% raw %}
61
55
# docker inspect --format '{{split (join .Names "/") "/"}}' container
62
- {% endraw %}
63
56
64
57
### Title
65
58
66
59
Title capitalizes a string.
67
60
68
- {% raw %}
69
61
$ docker inspect --format "{{title .Name}}" container
70
- {% endraw %}
71
62
72
63
### Upper
73
64
74
- Upper turns a string into its upper case representation.
65
+ Upper turms a string into its upper case representation.
75
66
76
- {% raw %}
77
67
$ docker inspect --format "{{upper .Name}}" container
78
- {% endraw %}
0 commit comments