tlog-play(8)

๐Ÿ’– tlog-play(8) โ€” the System Manager's Manual glow-up ๐Ÿ’–

okay bestie, so this is tlog-play, part of the tlog family, and it lives in section 8 of the System Manager's Manual. Think of it as the rewind button for your terminal. Let's get into it ๐ŸŽ€


โœจ NAME โœจ

tlog-play โ€” play back terminal I/O recorded by tlog-rec(8)


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

tlog-play [OPTION...]

๐Ÿ’… DESCRIPTION ๐Ÿ’…

So tlog-play is the playback program for terminal I/O that got recorded with tlog-rec(8). It re-plays the recording on whatever terminal you run it under, and here's the tea: it can't change its own size. So for playback to look right, your playback terminal size has to match the recorded terminal size. No cap, that's just how it is ๐Ÿ˜ญ

tlog-play pulls its parameters from the system-wide config file /etc/tlog/tlog-play.conf, and you can override any of that with the command-line options listed below. Iconic behaviour, honestly.


โญ OPTIONS โญ

๐ŸŒธ General options ๐ŸŒธ

  • -h, --help โ€” prints a command-line usage message and then dips. bye โœŒ๏ธ
  • -v, --version โ€” spits out version info and exits.
  • --configuration โ€” dumps the program configuration as JSON and exits. very demure, very mindful.
  • -s, --speed=NUMBER โ€” sets the playback speed multiplier to NUMBER.
    • NUMBER is a floating-point number, and the playback speed gets multiplied by it. You can literally adjust this mid-playback, it's giving live DJ ๐ŸŽง
    • Value minimum: 0
  • -f, --follow โ€” wait for new messages and play them back.
    • If you specify this, when playback hits the end of the recorded session it just... waits ๐Ÿซถ, and when new messages get added it plays them as they show up. obsessive follow energy.
  • -g, --goto=STRING โ€” fast-forward to STRING time (start/end/HH:MM:SS.sss).
    • STRING is a logical location, or a time to fast-forward the recording to. It can be the string "start", the string "end", or a timestamp formatted as HH:MM:SS.sss, where any part can be left out to mean zero. yes bestie, you can absolutely just skip to the good part โœจ
  • -p, --paused โ€” start playback paused.
    • If specified, playback starts out in a paused state. frozen. statue. ๐Ÿ’€
  • -r, --reader=STRING โ€” use the STRING log reader (file/journal/es, default file).
    • STRING is the type of "log reader" used for retrieving log messages. The reader you pick has to be configured with its own dedicated parameters, so don't forget those.
    • Value should be one of: "file", "journal", "es"
  • --persist โ€” ignore the quit key and signals from the keyboard.
    • If specified, ignore any keyboard-generated signals and the quit key. it simply will not be stopped ๐Ÿ˜ค
  • --lax โ€” ignore missing (dropped) log messages.
    • If specified, ignore missing (dropped, or lost) log messages. Otherwise it reports an error and aborts when a message is missing. so like, strict mode is the default, keep that in mind.

๐Ÿ“ File reader options ๐Ÿ“

  • -i, --file-path=FILE โ€” read the log from the FILE file.
    • FILE is the path to the file the "file" reader should read logs from.
  • -m, --file-match=STRING โ€” playback the explicit recording id specified in STRING.
    • STRING is the recording id of the recording the "file" reader should seek to for playback.

๐Ÿ” Elasticsearch reader options ๐Ÿ”

  • --es-baseurl=STRING โ€” Elasticsearch URL without query or fragment parts.
    • STRING is the base URL to request Elasticsearch through. Should not contain query (?...) or fragment (#...) parts.
  • --es-query=STRING โ€” Elasticsearch query.
    • STRING is the query string to send to Elasticsearch.
  • --es-verbose โ€” enable verbose output on the Elasticsearch HTTP client.
    • If specified, enable verbose output on the Elasticsearch HTTP client. it's giving loud and proud ๐Ÿ“ข

๐Ÿ—‚๏ธ Systemd journal reader options ๐Ÿ—‚๏ธ

  • -S, --journal-since=SECONDS โ€” start searching the journal at SECONDS since epoch.
    • SECONDS is the number of seconds since epoch to seek to before searching for the first matching log entry.
    • Value minimum: 0
  • -U, --journal-until=SECONDS โ€” stop searching the journal at SECONDS since epoch.
    • SECONDS is the number of seconds since epoch at which searching for log entries should stop.
    • Value minimum: 0
  • -M, --journal-match=STRING โ€” add STRING to the journal match symbol list.
  • -N, --journal-namespace=STRING โ€” search for the records in the STRING namespace only.
    • STRING is the Specifies a specific journal namespace to use.

๐ŸŽฎ CONTROLS ๐ŸŽฎ

You can drive playback with these keys, bestie. keyboard main character energy ๐Ÿ‘‘

  • SPACE, p โ€” pause/resume playback.
  • } โ€” double the playback speed. Maximum is 16x.
  • { โ€” halve the playback speed. Minimum is 1/16x.
  • BACKSPACE โ€” reset playback to normal, 1x speed.
  • . โ€” output the next packet immediately, without delay, regardless if paused or not. Press it when paused to step through the recording. Press it once to skip a long pause. Hold it to skip through the recording at constant speed (the keyboard repeat rate).
  • G โ€” fast-forward the recording to the end, or to a specified time. Works while playing and on pause. You can specify the time by typing in a timestamp before pressing 'G'. The timestamp should follow the format of the -g/--goto option value, but without the fractions of a second. The command has no effect if the specified time location has already been reached.
    • E.g. pressing just 'G' would fast-forward to the end, which is useful with following enabled. Pressing '3', '0', 'G' (typing "30G") would fast-forward to 30 seconds from the start of the recording. Typing "30:00G" would fast-forward to 30 minutes, and so would "30:G", and "1800G". Typing "2::G" would fast-forward to two hours into the recording, the same as "120:G" and "7200G".
  • q โ€” stop playing and quit.

๐Ÿ—ƒ๏ธ FILES ๐Ÿ—ƒ๏ธ

  • /etc/tlog/tlog-play.conf โ€” The system-wide configuration file

๐Ÿ’€ BUGS ๐Ÿ’€

okay so this part is important, listen up. Recordings can include control sequences attempting to communicate with the terminal, and the playback terminal would dutifully reply to them. tlog-play tries to filter these responses out, but since it's not a full terminal emulator itself, and since there's a great variety of such control sequences, it can sometimes fail, and interpret some of these as the playback control keys described above, with corresponding effects. ๐Ÿซ 

This is going to be fixed in future releases, possibly by embedding a proper terminal emulator in tlog-play. For now, most recordings would reproduce correctly, but some might exhibit erratic behavior, and it is possible to e.g. make a recording which would skip (hide) a part of itself on playback. However, there are other, easier ways to hide actions on a terminal, of course.

bestie. do not rely on this to hide your secrets. it's not even good at hiding them ๐Ÿ’…

๐ŸŒˆ EXAMPLES ๐ŸŒˆ

Play back contents of a file written with tlog-rec's "file" writer:

tlog-play -r file --file-path=recording.log

Play back a recording from Journal:

tlog-play -r journal -M TLOG_REC=6071524bb44d403991a00413ab7c8596-53bd-378c5d9

Play back a recording from Elasticsearch:

tlog-play -r es --es-baseurl=http://localhost:9200/tlog/tlog/_search --es-query=session:121

๐Ÿ‘€ SEE ALSO ๐Ÿ‘€

tlog-play.conf(5), tlog-rec(8)


๐Ÿซถ AUTHOR ๐Ÿซถ

Nikolai Kondrashov <spbnick@gmail.com>


and that's the whole page, no notes ๐Ÿ’– this was brought to you by Tlog, dated March 2016, and yeah the date is giving vintage but the vibes are forever. mwah ๐Ÿ’‹โœจ