1 2 3 4 5 6 7
#!/bin/sh awk ' /^@/ { match(FILENAME, "/[^/]*/@[^/]*$"); logdir = substr(FILENAME, RSTART+1, RLENGTH-29); print substr($0, 1, 26) "{" logdir "} " substr($0, 27); }' /mnt/container-logs/*/@* | sort | s6-tai64nlocal