Tlog - terminal I/O logging (recording) and playback
available in ubuntu since 22.04?
ref: https://scribery.github.io/tlog/
The JSON messages are structured to be particularly suitable for storage and searching by ElasticSearch, plus for (limited) human review. At the same time, they preserve all the passed data and timing (with 1ms resolution).
A typical industrial case/usage:
tlog -> rsyslogd -> ElasticSearch
RedHat tutorial Succeeded the 1st time after just installed, but failed for later tries.