I am trying to log some events in a remote syslog logging server (elk stack with syslog plugin).
I have managed to create docker
specific tags as follows:
logging:
driver: syslog
options:
syslog-address: "tcp://someserver:someport"
tag: '{{.Name}},{{.ImageName}}'
Is this an analogy for rancher tags?
The following syntax does not seem to work:
logging:
driver: syslog
options:
syslog-address: "tcp://someserver:someport"
tag: '{{ index .ContainerLabels "io.rancher.stack.name" }}'
The error I am getting for example in this approach is:
found unexpected end of stream
The following seems to cause no template specific errors but logs <no value>
tag: '{{ .io.rancher.stack.name }}'
Any suggestion if such a thing is feasible and what is the correct syntax?
UPDATE1: The following variable seems to provide the stack name: {{ Stack.Name }}
.
What other variables are available? {{ Service.Name }}
does not seem to work for example.
UPDATE2: Docker variables do not seem to be available in a rancher environment, i.e. the following
tag: '{{.Stack.Name}},{{.Name}},{{.ImageName}}'
will expand to:
mystack,<no value>,<no value>
UPDATE2: any idea why the following produces
yaml error: unexpected end of stream
logging:
driver: syslog
options:
syslog-address: "tcp://my-logging-server:my-logging-port
tag: '{{ index .ContainerLabels "io.rancher.stack.name" }}'