LNAV: an excellent tool for viewing system logs

lnav-multi-file2

Si you are a system administratorYou will not let me lie, because you will know that the use of the system registers is quite essential to be able to know what is happening, what changes have been made, what accesses have occurred, among other things.

Today we are going to share with you an excellent tool that I am sure can be extremely functional for you., this tool will help you a lot with the part of the system registries.

The program The Logfile Navigator or LNAV, is a command line tool for viewing system logs, this is a free and open source tool distributed under the BSD license.

Compared to the conventional cat, grepo less, offers some additional features, such as providing syntax highlighting, which can display multiple records at the same time, the lines that are ordered according to the date and time the event occurred, which offers different display modes among other things.

About LNAV

LNAV is a command line tool for viewing and navigating your system files, all on one device.

Esto allows you to offer syntax highlighting in recognized games and sort by date of events different lines of periods.

As the application takes care of automatically detecting the files from the log files, Likewise, if they are compressed, it decompresses the files on the fly.

Log files are a wealth of information, LNAV can help highlight the parts that are important and filter the information in this way.

This application knows how to open compressed files (gzip and bzip2) and follows an active log.

As well the use of filters is possible (to ignore certain messages to grep -v) and carry out research to highlight a phrase.

It is possible to use when an expression is captured and it will automatically complement it depending on the content.

The keyboard shortcuts are conventional (for example, g to go to the beginning of the file and G to go to the end, or to start a search).

It is also possible to play with the registers via SQL queries.

A system sessions will also keep certain information (eg filters).

Finally, the bar on the right allows you to quickly see which areas of the file had error lines or lines that match the search criteria.

Many logging tools, like Splunk, offer great features, but have been optimized for large-scale deployments.

Several of these require the installation and configuration of servers before they can be used effectively.

Among the main registers that this application supports we can find:

  • Common Web Access Log format
  • CUPS page_log
  • Syslog
  • Hawthorn
  • VMware ESXi / vCenter Logs
  • dpkg.log
  • uwsgi
  • Strace
  • sudo

How to install LNAV on Linux?

Si you want to install this application on your system, you must follow the steps that we share with you below.

In the case of those who are users of Debian, Ubuntu and derivatives we must download the deb package with:

wget https://github.com/tstack/lnav/releases/download/v0.8.3/lnav_0.8.3_amd64.deb

E we install with:

sudo dpkg -i lnav*.deb

While for the case of distributions with support for RPM packages, such as Fedora, CentOS, RHEL, openSUSE, and others should download this package:

wget https://github.com/tstack/lnav/releases/download/v0.8.3/lnav-0.8.3-1.x86_64.rpm
sudo rpm -i nav-0.8.3-1.x86_64.rpm

As well They can install the application with the help of the Snap packages, this is obtained with this command:

sudo snap install lnav

LNAV can be installed on any Linux system, we only have to have the following dependencies installed on our system:

  • gcc / clang
  • libpcre.
  • sqlite
  • ncurses
  • readline
  • zlib
  • bz2
  • libcurl
  • git

Basically, most Linux distributions have these within their official repositories, you will only have to install them to be able to compile the program on your system.

Already sure that you have all these dependencies, We must obtain the source code of the program in order to compile it.

For this We are going to download it with the following command:

git clone https://github.com/tstack/lnav.git
cd lnav

And we proceed to compile the application with:

./autogen.sh
./configure
make
sudo make install


3 comments, leave yours

Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   James said

    In Debian testing (10, buster) it is included, you just have to launch:

    # apt-get install lnav –verbose-versions

    The following NEW packages will be installed:
    lnav (0.8.3-1 + b1)

  2.   ROMSAT said

    Well, in Ubuntu 18.04 (bionic) you can install it by doing:

    $ sudo apt install lnav

    These two NEW packages will be installed: libpcrecpp0v5 and lnav (672 kB files)

    Greetings to everyone from Malaga.

  3.   dftg said

    Thank you for letting us know about this tool!
    … Devuan (Ascii), also includes it in its repositories 🙂