Files
nomad/e2e/alloc_logs/input/mixed-output.nomad
James Rasell 4848bfadec cli: stream both stdout and stderr when following an alloc. (#16556)
This update changes the behaviour when following logs from an
allocation, so that both stdout and stderr files streamed when the
operator supplies the follow flag. The previous behaviour is held
when all other flags and situations are provided.

Co-authored-by: Luiz Aoqui <luiz@hashicorp.com>
2023-04-04 10:42:27 +01:00

36 lines
486 B
HCL

job "alloc-logs" {
datacenters = ["dc1"]
type = "service"
#constraint {
# attribute = "${attr.kernel.name}"
# value = "linux"
#}
group "alloc-logs" {
task "test" {
driver = "raw_exec"
template {
data = <<EOH
while true
do
echo stdout >&1
sleep 1
echo stderr >&2
sleep 1
done
EOH
destination = "local/echo.sh"
}
config {
command = "bash"
args = ["local/echo.sh"]
}
}
}
}