Nomad: "tail -f" logs for a job for all instances

there is kubetail which enables you to aggregate (tail/follow) logs from multiple pods into one stream. This is the same as running "kubectl logs -f " but for multiple pods. … but it is for kubernetes.

nomad logs -tail -f -job [job-name]

tails logs of a single, random instance of a job which is only “somewhat” useful.

yes, logs from multiple instances can be/are shipped to ELK/splunk, etc…
but they are available on all nomad instances, so some ssh mockery with a poor user experience can be done.

but. why not do better? nomad knows about the mounts OR about the logs that are available in stdout.

so the questions (and if the answer is “no”, then the ask :slight_smile: ) what is the way to:

nomad logs -tail -f -job [job-name] --all-instances

so see the logs in the terminal from all instances of a job?

Hi @tolitius,

As you mention there is not currently a native way to do this from the Nomad CLI, however, I believe this would be a nice enhancement.

Would be be able to raise a feature request against the Nomad repository? This would allow to team to gain visibility on the request and also allow the community to add thoughts.

Thanks,
jrasell and the Nomad team

Would be be able to raise a feature request against the Nomad repository?

done: “tail -f” logs for a job for all instances · Issue #10308 · hashicorp/nomad · GitHub

thanks James

1 Like