If i have server log, Any tools that can help in viewing the logs and filter based on exceptions and errors?
Currently, I am using Notepad++.
If i have server log, Any tools that can help in viewing the logs and filter based on exceptions and errors?
Currently, I am using Notepad++.
I usually use grep
and less
or Splunk if available. Less is good when you are working with one file, grep is good when you work with a whole directory structure. Splunk is good if you can afford it.
To use less:
less a-log-file.txt
And then use available shortcuts. The ones I most often use are: F
, ?pattern
, N
, n
, G
, g
.
To use grep:
grep a-directory-with-logs/* IOException
And use the available options, the ones I most often use include: -r
, -C
, -i
.
I often combine those in a shell with tools like find
, wc
, sort
, uniq
, tee
, sed
, awk
for example:
To get unique sorted values of the 3rd column of the log file only for entries for the given ip:
find /nfs/logs -name \*access.log | xargs -I {} grep {} 192.168.0.1 | awk '{print $3}' | uniq | sort
Is there a software for Less or grep ?
What do you mean by “a software for less and grep”?
The Log File Navigator, lnav (http://lnav.org/), is a useful
command-line tool for popular log file formats.