2025-03-14 21:59:59 -06:00
|
|
|
# tspin
|
|
|
|
|
|
|
|
|
|
> A log file highlighter based on the `less` pager and basically behaves like any pager.
|
2026-02-18 06:55:01 -07:00
|
|
|
> More information: <https://github.com/bensadeh/tailspin#usage>.
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
- View a log file using the default pager (`less`):
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
`tspin {{path/to/file.log}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
- Read from another command and print to `stdout`:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
`{{command}} | tspin`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
- Read from a file and print to `stdout` without paging:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
`tspin {{path/to/file.log}} {{[-p|--print]}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
- Follow a file (mimics `tail -f`) and highlight new entries:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
`tspin {{[-f|--follow]}} {{path/to/file.log}}`
|
|
|
|
|
|
|
|
|
|
- Highlight specific groups only (possible values: `numbers`, `urls`, `pointers`, `dates`, `paths`, `quotes`, `key-value-pairs`, `uuids`, `ip-addresses`, `processes`, `json`):
|
|
|
|
|
|
|
|
|
|
`tspin --enable {{urls,ip-addresses,...}} {{path/to/file.log}}`
|
|
|
|
|
|
|
|
|
|
- Use a custom pager (the `[FILE]` string is a required literal placeholder):
|
|
|
|
|
|
|
|
|
|
`tspin --pager "{{bat -p}} [FILE]" {{path/to/file.log}}`
|
|
|
|
|
|
|
|
|
|
- Highlight custom strings with custom colors:
|
|
|
|
|
|
|
|
|
|
`tspin --highlight {{red}}:{{ERROR,WARNING,...}} {{path/to/file.log}}`
|
|
|
|
|
|
|
|
|
|
- Run the provided command and view the output in `less`:
|
|
|
|
|
|
|
|
|
|
`tspin --exec='{{command}}'`
|