In RHEL 9, when running a task with logging.driver set to journald, the alloc logs shows empty lines between the real lines.
It doesn't happen when logging.driver is set to nomad
The output of nomad alloc logs -task redis -job redis is:
1:C 08 May 2024 04:38:17.279 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
1:C 08 May 2024 04:38:17.281 * oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 08 May 2024 04:38:17.281 * Redis version=7.2.4, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 08 May 2024 04:38:17.281 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
1:M 08 May 2024 04:38:17.283 * monotonic clock: POSIX clock_gettime
1:M 08 May 2024 04:38:17.284 * Running mode=standalone, port=6379.
1:M 08 May 2024 04:38:17.285 * Server initialized
1:M 08 May 2024 04:38:17.285 * Ready to accept connections tcp
In RHEL 9, when running a task with logging.driver set to journald, the alloc logs shows empty lines between the real lines. It doesn't happen when logging.driver is set to nomad
Given the following
redis.hcl
:./nomad agent -dev -plugin-dir /root/plugins
nomad job run redis.hcl
nomad alloc logs -task redis -job redis
is:1:C 08 May 2024 04:38:17.281 * oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 08 May 2024 04:38:17.281 * Redis version=7.2.4, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 08 May 2024 04:38:17.281 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
1:M 08 May 2024 04:38:17.283 * monotonic clock: POSIX clock_gettime
1:M 08 May 2024 04:38:17.284 * Running mode=standalone, port=6379.
1:M 08 May 2024 04:38:17.285 * Server initialized
1:M 08 May 2024 04:38:17.285 * Ready to accept connections tcp