Difference between revisions of "Linux multitail"

From Ever changing code
Jump to navigation Jump to search
 
Line 15: Line 15:
*<code>ctrl</code> + <code>g</code> cancel /or return /or exit
*<code>ctrl</code> + <code>g</code> cancel /or return /or exit


= Cheatsheet =  
= Cheatsheet =
while the program runs
while the program runs
<source lang=bash>  
<source lang=bash>
r Redraws the screen.
r Redraws the screen.
q x Exit the program.
q x Exit the program.
0...9 Add a thick red line to window 0...9.  e Edit the regular
0...9 Add a thick red line to window 0...9.  e Edit the regular
expression for a window. First you have to enter the window-
expression for a window. First you have to enter the window-
number (look at the status-line; just before the filename) and
number (look at the status-line; just before the filename) and
then you can edit the regular expression for that window. Empty
then you can edit the regular expression for that window. Empty
the line to delete the regular expression.
the line to delete the regular expression.
d Delete a window
d Delete a window
a Add a window
a Add a window
s Swap the positions of 2 windows
s Swap the positions of 2 windows
v Toggle vertical screen split
v Toggle vertical screen split
z Hide/unhide window
z Hide/unhide window
c Set colors
c Set colors
w Write script for restarting MultiTail.
w Write script for restarting MultiTail.
m Set marker
m Set marker
n Delete a marker
n Delete a marker
b Scroll back (and forth)
b Scroll back (and forth)
p q
p q
i Info </source>
i Info </source>




"scroll back"-menu
"scroll back"-menu
<source lang=bash>
<source lang=bash>
x q Exit this screen.
x q Exit this screen.
f / Search for a string. You can enter a regular expression or just the string to search for.
f / Search for a string. You can enter a regular expression or just the string to search for.
n Search next instance, see f and /
n Search next instance, see f and /
e Edit regular expression (filter) for displaying.
e Edit regular expression (filter) for displaying.
s Save buffered lines to file.
s Save buffered lines to file.
</source>
</source>
Line 50: Line 50:


command line options
command line options
<source lang=bash>
<source lang=bash>
-i Input file
-i Input file
-I Same as -i but add the output to the previous window (so the output is merged).
-I Same as -i but add the output to the previous window (so the output is merged).
-l Command to execute in a window. Parameter is the command. Double quotes for args
-l Command to execute in a window. Parameter is the command. Double quotes for args
-L Same as -l but add the output to the previous window (so the output is merged).
-L Same as -l but add the output to the previous window (so the output is merged).
-r interval Restart the command (started with -l/-L) after it has exited.
-r interval Restart the command (started with -l/-L) after it has exited.
-R interval With interval you can set how long to sleep before restarting.
-R interval With interval you can set how long to sleep before restarting.
Same as -r, only with this one only the difference is displayed.
Same as -r, only with this one only the difference is displayed.
-f Follow the following filename, not the descriptor.
-f Follow the following filename, not the descriptor.
-e Use the next regular expression on the following file.
-e Use the next regular expression on the following file.
-ec Use regular expression on the following file and display the matches.
-ec Use regular expression on the following file and display the matches.
-eC Use regular expression on the following file but display everything and display the matches inverted.
-eC Use regular expression on the following file but display everything and display the matches inverted.
-E Use the next regular expression on the following files.
-E Use the next regular expression on the following files.
-v Negate the next regular expression.
-v Negate the next regular expression.
-s Splits the screen also vertically.
-s Splits the screen also vertically.
-cs Show the next given file in colors (through syslog-scheme).
-cs Show the next given file in colors (through syslog-scheme).
-c Show the next given file in colors.
-c Show the next given file in colors.
-cS scheme
-cS scheme
Show the next given file using the colorscheme selected with
Show the next given file using the colorscheme selected with
scheme (as defined in multitail.conf).
scheme (as defined in multitail.conf).
-Cs Show all following files in color (through syslog-scheme).
-Cs Show all following files in color (through syslog-scheme).
-C Show all following files in color.
-C Show all following files in color.
-Cf field_index delimiter
-Cf field_index delimiter
Show all following files in color depending on field selected
Show all following files in color depending on field selected
with field_index. Fields are delimited by the defined delimiter.
with field_index. Fields are delimited by the defined delimiter.
-cf field_index delimiter
-cf field_index delimiter
Show the next file in color depending on field selected with
Show the next file in color depending on field selected with
field_index. Fields are delimited by the defined delimiter.
field_index. Fields are delimited by the defined delimiter.
-m nlines
-m nlines
Set mark and remember nlines lines. Set nlines to 0 (zero) if you want no limits on the buffering. Use this if you want to scroll back.
Set mark and remember nlines lines. Set nlines to 0 (zero) if you want no limits on the buffering. Use this if you want to scroll back.
-M nlines Set a mark on ALL following files.
-M nlines Set a mark on ALL following files.
-p x [y]
-p x [y]
Set linewrap: a = print everything including linewrap. l = just
Set linewrap: a = print everything including linewrap. l = just
show everything starting at the left until the rightside of the
show everything starting at the left until the rightside of the
window is reached. r = show everything starting from the right
window is reached. r = show everything starting from the right
of the line. s = show everything starting with the processname.
of the line. s = show everything starting with the processname.
S = show everything starting after the processname. o = show
S = show everything starting after the processname. o = show
everything starting at offset 'y'.
everything starting at offset 'y'.
Line 92: Line 92:




examples
examples
<source lang=bash>
<source lang=bash>
multitail logfile -l "ping 192.168.1.3"
multitail logfile -l "ping 192.168.1.3"
creates 2 windows, logfile content and output of ping command
creates 2 windows, logfile content and output of ping command
multitail -R 2 -l "netstat -t"
multitail -R 2 -l "netstat -t"
</source>
</source>
[[Category: linux]]
[[Category: linux]]

Latest revision as of 10:15, 26 February 2020

Multitail allows to view many logs in multi window terminal.

Install

sudo apt-get install multitail

Key bindings

  • u select full size window; hide all windows except the one selected, cannot scroll
  • U back to multi-window view; un-hide all windows
  • b select a window to preview in a pop-up window, you can scroll
  • G select window to dump to a file
  • d delete window
  • m limit of lines to display, equivalent eg. tail -500
  • q exit
  • ctrl + g cancel /or return /or exit

Cheatsheet

while the program runs

r Redraws the screen.
q x	Exit the program.
0...9	Add a thick red line to window 0...9.  e Edit the regular
	expression for a window. First you have to enter the window-
	number (look at the status-line; just before the filename) and
	then you can edit the regular expression for that window. Empty
	the line to delete the regular expression.
d	Delete a window
a	Add a window
s	Swap the positions of 2 windows
v	Toggle vertical screen split
z	Hide/unhide window
c	Set colors
w	Write script for restarting MultiTail.
m	Set marker
n	Delete a marker
b	Scroll back (and forth)
p	q
i	Info


"scroll back"-menu

x q	Exit this screen.
f /	Search for a string. You can enter a regular expression or just the string to search for.
n	Search next instance, see f and /
e	Edit regular expression (filter) for displaying.
s	Save buffered lines to file.


command line options

-i	Input file
-I	Same as -i but add the output to the previous window (so the output is merged).
-l	Command to execute in a window. Parameter is the command. Double quotes for args
-L	Same as -l but add the output to the previous window (so the output is merged).
-r interval		Restart the command (started with -l/-L) after it has exited.
-R interval		With interval you can set how long to sleep before restarting.
		Same as -r, only with this one only the difference is displayed.
-f	Follow the following filename, not the descriptor.
-e	Use the next regular expression on the following file.
-ec	Use regular expression on the following file and display the matches.
-eC	Use regular expression on the following file but display everything and display the matches inverted.
-E	Use the next regular expression on the following files.
-v	Negate the next regular expression.
-s	Splits the screen also vertically.
-cs	Show the next given file in colors (through syslog-scheme).
-c	Show the next given file in colors.
-cS	scheme
	Show the next given file using the colorscheme selected with
	scheme (as defined in multitail.conf).
-Cs	Show all following files in color (through syslog-scheme).
-C	Show all following files in color.
-Cf field_index delimiter
	Show all following files in color depending on field selected
	with field_index. Fields are delimited by the defined delimiter.
-cf field_index delimiter
	Show the next file in color depending on field selected with
	field_index. Fields are delimited by the defined delimiter.
-m nlines
	Set mark and remember nlines lines. Set nlines to 0 (zero) if you want no limits on the buffering. Use this if you want to scroll back.
-M nlines Set a mark on ALL following files.
-p x [y]
	Set linewrap: a = print everything including linewrap. l = just
	show everything starting at the left until the rightside of the
	window is reached. r = show everything starting from the right
	of the line. s = show everything starting with the processname.
	S = show everything starting after the processname. o = show
	everything starting at offset 'y'.
-H interval Visual heart-beat (usefull when you want to keep your session alive). Interval is in seconds.


examples

multitail logfile -l "ping 192.168.1.3"
	creates 2 windows, logfile content and output of ping command
multitail -R 2 -l "netstat -t"