0

LNAV additionally understand as Lateral Navigation is a totally free and source that is open log file viewer that can be used to find information of files being viewed along with the time stamps and log levels. LNAV is a command line log file viewer built for small solutions that are scale. Its easy, user friendly and customizable. LNAV is a application that is totally freeware runs on Linux and Mac operating systems. It enables user to display logs from multiple files in a window that is single you’re additionally capable see a live up-date to these logs.

LNAV is sold with great deal’s of features, a few of them are the following:

  • Allows one to inquiries log through SQL.
  • Ability to identify and read logs from numerous log platforms.
  • It has lightening that is coloring that help users easily identify differences among info, warning and error.
  • Automatically extract data from compress file like, gzip and bzip2.
  • Ability to search logs as you type. New log lines are automatically searched and loaded because they are added.

In this guide, we’ll explain how exactly to install and make use of lnav on Ubuntu 16.04 host.

Requirements

  • A host operating Ubuntu 16.04.
  • A non-root individual with sudo privileges.

Install Lnav

By standard, lnav will come in Ubuntu 16.04 standard repository. By just running the following command:

sudo apt-get install lnav -y

After installing lnav, you can view the version of the lnav by running the following command:

lnav -V

You should see the following output:

lnav 0.6.2
 so you can install it; 

Working with Lnav

You can view all the options of lnav using the command that is following***********)

lnav -h

You should start to see the after production:

usage: lnav [-hVsar] [logfile1 logfile2 ...]
 
 A curses-based log file audience that indexes log communications by type
 and time for you to ensure it is better to navigate through files quickly.
 
 Key bindings:
   ?     View/leave the help that is online.
   Q     Quit the scheduled system.
 
 choices:
   -h         Print this message, then exit.
   -C         Check setup then exit.
   -d file    Write debug communications towards the offered file.
   -V         Print variation information.
   -s         Load the absolute most syslog that is recent file.
   -a         Load all of the most log that is recent kinds.
   -r         Load older log that is rotated as well.
   -t         Prepend timestamps to the lines of data being read in
              on the standard input.
   -w file    Write the contents of the standard input to this file.
 
 Optional arguments:
   logfile1          The log files or directories to view.  If a
                     directory is given, all of the files in the
                     directory  be packed.
 
 Examples:
   To load and stick to the syslog file:
     $ lnav -s
 
   To load the files in /var/log:
     $ lnav /var/log
 
   to look at the production of making with timestamps prepended:
     $ make 2>  -t
 
 Version: lnav 0.6.2
 

Now, let’s start to run lnav command to see the time that is real based on latest time stamps from all log files. This demand shall collect log from all file inside /var/log directory.

sudo lnav

You should see the output that is following***********)

Jan 28 16:56:01 icingaclient wpa_supplicant[926]: wlan0: CTRL-EVENT-SCAN-STARTED
 Jan 28 16:59:46 icingaclient dhclient: DHCPREQUEST of 192.168.137.101 on wlan0 to 192.168.137.1 slot 67 (xid=0xcd468e)
 Jan 28 16:59:46 icingaclient dhclient: DHCPACK of 192.168.137.101 from 192.168.137.1
 Jan 28 16:59:46 icingaclient dhclient: bound to 192.168.137.101 -- renewal in 273 moments.
 Jan 28 16:59:46 icingaclient NetworkManager[865]:  (wlan0): DHCPv4 state changed reboot -> renew
 Jan 28 16:59:46 icingaclient NetworkManager[865]:    target 192.168.137.101
 Jan 28 16:59:46 icingaclient NetworkManager[865]:    prefix 24 (255.255.255.0)
 Jan 28 16:59:46 icingaclient NetworkManager[865]:    gateway 192.168.137.1
 Jan 28 16:59:46 icingaclient NetworkManager[865]:    nameserver '192.168.137.1'
 Jan 28 16:59:46 icingaclient NetworkManager[865]:    domain title 'mshome.net'
 Jan 28 16:59:46 icingaclient dbus[779]: [system] Activating solution title='org.freedesktop.nm_dispatcher' (using servicehelper)
 Jan 28 16:59:46 icingaclient dbus[779]: [system] effectively activated solution 'org.freedesktop.nm_dispatcher'
 Jan 28 17:04:19 icingaclient dhclient: DHCPREQUEST of 192.168.137.101 on wlan0 to 192.168.137.1 slot 67 (xid=0xcd468e)
 Jan 28 17:04:19 icingaclient dhclient: DHCPACK of 192.168.137.101 from 192.168.137.1
 Jan 28 17:04:20 icingaclient dhclient: bound to 192.168.137.101 -- renewal in 226 moments.
 Jan 28 17:04:20 icingaclient NetworkManager[865]:  (wlan0): DHCPv4 state changed-> that is renew renew
 Jan 28 17:04:20 icingaclient NetworkManager[865]:    address 192.168.137.101
 Jan 28 17:04:20 icingaclient NetworkManager[865]:    prefix 24 (255.255.255.0)
 Jan 28 17:04:20 icingaclient NetworkManager[865]:    gateway 192.168.137.1
 Jan 28 17:04:20 icingaclient NetworkManager[865]:    nameserver '192.168.137.1'
 Jan 28 17:04:20 icingaclient NetworkManager[865]:    domain name 'mshome.net'
 Jan 28 17:04:20 icingaclient dbus[779]: [system] Activating service name='org.freedesktop.nm_dispatcher' (using servicehelper)
 Jan 28 17:04:20 icingaclient dbus[779]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
 Jan 28 17:05:01 icingaclient CRON[3964]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
 Jan 28 17:08:06 icingaclient dhclient: DHCPREQUEST of 192.168.137.101 on wlan0 to 192.168.137.1 port 67 (xid=0xcd468e)
 Jan 28 17:08:06 icingaclient dhclient: DHCPACK of 192.168.137.101 from 192.168.137.1
 Jan 28 17:08:06 icingaclient dhclient: bound to 192.168.137.101 -- renewal in 297 seconds.
 Jan 28 17:08:06 icingaclient NetworkManager[865]:  (wlan0): DHCPv4 state changed-> that is renew renew
 Jan 28 17:08:06 icingaclient NetworkManager[865]:    target 192.168.137.101
 Jan 28 17:08:06 icingaclient NetworkManager[865]:    prefix 24 (255.255.255.0)
 Jan 28 17:08:06 icingaclient NetworkManager[865]:    gateway 192.168.137.1
 Jan 28 17:08:06 icingaclient NetworkManager[865]:    nameserver '192.168.137.1'
 Jan 28 17:08:06 icingaclient NetworkManager[865]:    domain title 'mshome.net'
 Jan 28 17:08:06 icingaclient dbus[779]: [system] Activating solution title='org.freedesktop.nm_dispatcher' (using servicehelper)
 Jan 28 17:08:06 icingaclient dbus[779]: [system] effectively activated solution 'org.freedesktop.nm_dispatcher'
 

If you need to see log from /var/log/apache2 directory, run these demand:

sudo lnav /var/log/apache2

Sometimes, the newest information aren’t obtainable in the most up-to-date files. To show information from old log files utilising the -r choice:

sudo lnav -r

You should start to see the after production:

Jan 28 17:04:20 icingaclient dhclient: bound to 192.168.137.101 -- renewal in 226 moments.
 Jan 28 17:04:20 icingaclient NetworkManager[865]:  (wlan0): DHCPv4 state changed-> that is renew renew
 Jan 28 17:04:20 icingaclient NetworkManager[865]:    address 192.168.137.101
 Jan 28 17:04:20 icingaclient NetworkManager[865]:    prefix 24 (255.255.255.0)
 Jan 28 17:04:20 icingaclient NetworkManager[865]:    gateway 192.168.137.1
 Jan 28 17:04:20 icingaclient NetworkManager[865]:    nameserver '192.168.137.1'
 Jan 28 17:04:20 icingaclient NetworkManager[865]:    domain name 'mshome.net'
 Jan 28 17:04:20 icingaclient dbus[779]: [system] Activating service name='org.freedesktop.nm_dispatcher' (using servicehelper)
 Jan 28 17:04:20 icingaclient dbus[779]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
 Jan 28 17:05:01 icingaclient CRON[3964]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
 Jan 28 17:08:06 icingaclient dhclient: DHCPREQUEST of 192.168.137.101 on wlan0 to 192.168.137.1 port 67 (xid=0xcd468e)
 Jan 28 17:08:06 icingaclient dhclient: DHCPACK of 192.168.137.101 from 192.168.137.1
 Jan 28 17:08:06 icingaclient dhclient: bound to 192.168.137.101 -- renewal in 297 seconds.
 Jan 28 17:08:06 icingaclient NetworkManager[865]:  (wlan0): DHCPv4 state changed-> that is renew renew
 Jan 28 17:08:06 icingaclient NetworkManager[865]:    target 192.168.137.101
 Jan 28 17:08:06 icingaclient NetworkManager[865]:    prefix 24 (255.255.255.0)
 Jan 28 17:08:06 icingaclient NetworkManager[865]:    gateway 192.168.137.1
 Jan 28 17:08:06 icingaclient NetworkManager[865]:    nameserver '192.168.137.1'
 Jan 28 17:08:06 icingaclient NetworkManager[865]:    domain title 'mshome.net'
 Jan 28 17:08:06 icingaclient dbus[779]: [system] Activating solution title='org.freedesktop.nm_dispatcher' (using servicehelper)
 Jan 28 17:08:06 icingaclient dbus[779]: [system] effectively activated solution 'org.freedesktop.nm_dispatcher'
 Jan 28 17:12:47 icingaclient********) that is dnsmasq( nameserver 192.168.137.1 refused to do a recursive query
 Jan 28 17:13:03 icingaclient dhclient: DHCPREQUEST of 192.168.137.101 on wlan0 to 192.168.137.1 port 67 (xid=0xcd468e)
 Jan 28 17:13:03 icingaclient dhclient: DHCPACK of 192.168.137.101 from 192.168.137.1
 Jan 28 17:13:03 icingaclient dhclient: bound to 192.168.137.101 -- renewal in 291 seconds.
 

You can also view the log file with timestamps options using the -t option:

sudo lnav***********) that is-t(************)You should start to see the after production:

Jan 28 17:08:06 icingaclient dhclient: DHCPACK of 192.168.137.101 from 192.168.137.1
 Jan 28 17:08:06 icingaclient dhclient: bound to 192.168.137.101 -- renewal in 297 moments.
 Jan 28 17:08:06 icingaclient NetworkManager[865]:  (wlan0): DHCPv4 state changed-> that is renew renew
 Jan 28 17:08:06 icingaclient NetworkManager[865]:    address 192.168.137.101
 Jan 28 17:08:06 icingaclient NetworkManager[865]:    prefix 24 (255.255.255.0)
 Jan 28 17:08:06 icingaclient NetworkManager[865]:    gateway 192.168.137.1
 Jan 28 17:08:06 icingaclient NetworkManager[865]:    nameserver '192.168.137.1'
 Jan 28 17:08:06 icingaclient NetworkManager[865]:    domain name 'mshome.net'
 Jan 28 17:08:06 icingaclient dbus[779]: [system] Activating service name='org.freedesktop.nm_dispatcher' (using servicehelper)
 Jan 28 17:08:06 icingaclient dbus[779]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
 Jan 28 17:12:47 icingaclient********) that is dnsmasq( nameserver 192.168.137.1 declined doing a recursive question
 Jan 28 17:13:03 icingaclient dhclient: DHCPREQUEST of 192.168.137.101 on wlan0 to 192.168.137.1 slot 67 (xid=0xcd468e)
 Jan 28 17:13:03 icingaclient dhclient: DHCPACK of 192.168.137.101 from 192.168.137.1
 Jan 28 17:13:03 icingaclient dhclient: bound to 192.168.137.101 -- renewal in 291 moments.
 Jan 28 17:13:03 icingaclient NetworkManager[865]:  (wlan0): DHCPv4 state changed-> that is renew renew
 Jan 28 17:13:03 icingaclient NetworkManager[865]:    address 192.168.137.101
 Jan 28 17:13:03 icingaclient NetworkManager[865]:    prefix 24 (255.255.255.0)
 Jan 28 17:13:03 icingaclient NetworkManager[865]:    gateway 192.168.137.1
 Jan 28 17:13:03 icingaclient NetworkManager[865]:    nameserver '192.168.137.1'
 Jan 28 17:13:03 icingaclient NetworkManager[865]:    domain name 'mshome.net'
 Jan 28 17:13:03 icingaclient dbus[779]: [system] Activating service name='org.freedesktop.nm_dispatcher' (using servicehelper)
 Jan 28 17:13:03 icingaclient dbus[779]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
 

To load all of the most log that is recent kinds, operate these demand:

sudo lnav -a

Use Hotkey with Lnav

You may also navigate the production of lnav demand making use of different hotkey choices.

First, run lnav demand:

sudo lnav

You should start to see the after production:

Lnav log viewer

Now, usage i key from your own keyboard to change lnav production to histogram view as shown below:

Lnav hotkeys

Next, usage p key to see the log parser outcome as shown below:

Lnav p key

Next, usage m key to mark the most notable log files as shown below:

lnav m key

Conclusion

i really hope now you can effortlessly distinguishing issues lnav that is using. You can also refer its site that is official for details. Please feel free to remarks when you have any relevant concerns.

Quickest easiest method to put in OpenVPN Server

Previous article

Just how to Migrate from Amazon S3 to DigitalOcean areas with rclone

Next article

You may also like

Comments

Leave a reply

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

More in Linux