{"id":11705,"date":"2019-03-15T22:54:58","date_gmt":"2019-03-15T22:54:58","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=11705"},"modified":"2019-03-15T22:54:58","modified_gmt":"2019-03-15T22:54:58","slug":"goaccess-a-real-time-apache-and-nginx-web-server-log-analyzer","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/15\/goaccess-a-real-time-apache-and-nginx-web-server-log-analyzer\/","title":{"rendered":"GoAccess (A Real-Time Apache and Nginx) Web Server Log Analyzer"},"content":{"rendered":"<p><strong>GoAccess<\/strong>\u00a0is an interactive and real time web server log analyzer program that quickly analyze and view web server logs. It comes as an open source and runs as a command line in Unix\/Linux operating systems. It provides brief and beneficial HTTP (web server) statistics report for Linux administrators on the fly. It also take care of both the\u00a0<strong>Apache<\/strong>\u00a0and\u00a0<strong>Ngnix<\/strong>\u00a0web server log formats.<\/p>\n<p><strong>GoAccess<\/strong>\u00a0parses and analyze the given web server log formats in preferred options including\u00a0<strong>CLF<\/strong>\u00a0(<strong>Common Log Format<\/strong>),\u00a0<strong>W3C<\/strong>\u00a0format (<strong>IIS<\/strong>) and Apache virtual hosts and then generate output of the data to the terminal.<\/p>\n<h4>GoAccess Features<\/h4>\n<p>It has the following features.<\/p>\n<ol>\n<li>General Statistics, bandwidth etc.<\/li>\n<li>Top Visitors, Visitors Time Distribution, Referring Sites &amp; URLs and 404 or Not Found.<\/li>\n<li>Hosts, Reverse DNS, IP Location.<\/li>\n<li>Operating Systems, Browsers and Spiders.<\/li>\n<li>HTTP Status Codes<\/li>\n<li>Geo Location \u2013 Continent\/Country\/City<\/li>\n<li>Metrics per Virtual Host<\/li>\n<li>Support for HTTP\/2 &amp; IPv6<\/li>\n<li>Ability to output JSON and CSV<\/li>\n<li>Incremental log processing and support for large datasets + data persistence<\/li>\n<li>Different Color Schemes<\/li>\n<\/ol>\n<h3>How Do I Install GoAccess?<\/h3>\n<p>Presently, the most recent version of\u00a0<strong>GoAccess 0.9.7<\/strong>\u00a0is not available from default system package repositories, so to install latest stable version, you need to manually download and compile it from source code under Linux systems as shown:<\/p>\n<h4>Install GoAccess from Source<\/h4>\n<pre># yum install ncurses-devel glib2-devel geoip-devel\r\n# cd \/usr\/src\r\n# wget http:\/\/tar.goaccess.io\/goaccess-0.9.8.tar.gz\r\n# tar zxvf goaccess-0.9.8.tar.gz\r\n# cd goaccess-0.9.8\/\r\n# .\/configure\r\n# make; make install\r\n<\/pre>\n<h4>Install GoAccess Using Package Manager<\/h4>\n<p>The easiest and preferred way to install GoAccess on Linux using the default package manager of your respective Linux distribution.<\/p>\n<p><strong>Note:<\/strong>\u00a0As I said above, not all distributions will have the most recent version of GoAccess available in the system default repositories..<\/p>\n<h5>On RedHat, CentOS and Fedora<\/h5>\n<pre># yum install goaccess\r\n# dnf install goaccess    [From <strong>Fedora 23+<\/strong> versions]\r\n<\/pre>\n<h5>On Debian and Ubuntu Systems<\/h5>\n<p><strong>GoAccess<\/strong>\u00a0utility is available since\u00a0<strong>Debian Squeeze 6<\/strong>\u00a0and\u00a0<strong>Ubuntu 11.04<\/strong>. To install just run the following command on the terminal.<\/p>\n<pre># apt-get install goaccess\r\n<\/pre>\n<p><strong>Note:<\/strong>\u00a0The above command will not always provide you the most latest version. To get the latest stable version of GoAccess, add the official GoAccess Debian &amp; Ubuntu repository as shown:<\/p>\n<pre>$ echo \"deb http:\/\/deb.goaccess.io\/ $(lsb_release -cs) main\" | sudo tee -a \/etc\/apt\/sources.list.d\/goaccess.list\r\n$ wget -O - http:\/\/deb.goaccess.io\/gnugpg.key | sudo apt-key add -\r\n$ sudo apt-get update\r\n$ sudo apt-get install goaccess\r\n<\/pre>\n<h3>How Do I Use GoAccess?<\/h3>\n<p>Once,\u00a0<strong>goaccess<\/strong>\u00a0is installed, execute \u2018<strong>goaccess<\/strong>\u2018 command without any arguments will list the help menu.<\/p>\n<pre># goaccess<\/pre>\n<h5>Sample Output<\/h5>\n<pre>GoAccess - 0.9.8\r\n\r\nUsage: goaccess [ options ... ] -f log_file [-c][-M][-H][-q][-d][...]\r\nThe following options can also be supplied to the command:\r\n\r\nLog &amp; Date Format Options\r\n\r\n  --log-format=        - Specify log format. Inner quotes need to\r\n                                    be escaped, or use single quotes.\r\n  --date-format=      - Specify log date format. e.g.,\r\n                                    %d\/%b\/%Y\r\n  --time-format=      - Specify log time format. e.g.,\r\n                                    %H:%M:%S\r\n\r\nUser Interface Options\r\n\r\n  -c --config-dialog              - Prompt log\/date\/time configuration\r\n                                    window.\r\n  -i --hl-header                  - Color highlight active panel.\r\n  -m --with-mouse                 - Enable mouse support on main dashboard.\r\n  --color=&lt;fg:bg[attrs, PANEL]&gt;   - Specify custom colors. See manpage for\r\n                                    more details and options.\r\n  --color-scheme=&lt;1|2&gt;            - Color schemes: 1 =&gt; Grey, 2 =&gt; Green.\r\n  --html-report-title=     - Set HTML report page title and header.\r\n  --no-color                      - Disable colored output.\r\n  --no-column-names               - Don't write column names in term\r\n                                    output.\r\n  --no-csv-summary                - Disable summary metrics on the CSV\r\n                                    output.\r\n  --no-progress                   - Disable progress metrics.\r\n  --no-tab-scroll                 - Disable scrolling through panels on TAB.\r\n\r\nFile Options\r\n\r\n  -f --log-file=        - Path to input log file.\r\n  -l --debug-file=      - Send all debug messages to the specified\r\n                                    file.\r\n  -p --config-file=     - Custom configuration file.\r\n  --invalid-requests=   - Log invalid requests to the specified\r\n                                    file.\r\n  --no-global-config              - Don't load global configuration\r\n                                    file.\r\n.....\r\n<\/pre>\n<p>The easiest way to get the any web server statistics use the flag \u2018<code>f<\/code>\u2018 with input log file name as shown below. The below command will give you general statistics of your web server logs.<\/p>\n<pre># goaccess -f \/var\/log\/httpd\/tecmint.com\r\n# goaccess -f \/var\/log\/nginx\/tecmint.com\r\n<\/pre>\n<p>The above command gives you an complete overview of web server metrics by showing summaries of various reports as panels on a one scrollable view as shown.<\/p>\n<h4>Apache Logs Overview<\/h4>\n<div id=\"attachment_20019\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/03\/View-Apache-Logs.png\" rel=\"attachment wp-att-20019\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-20019\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/03\/View-Apache-Logs.png\" sizes=\"auto, (max-width: 862px) 100vw, 862px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/03\/View-Apache-Logs.png 862w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/03\/View-Apache-Logs-768x900.png 768w\" alt=\"View Web Server Apache Logs\" width=\"862\" height=\"1010\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">View Web Server Apache Logs<\/p>\n<\/div>\n<h4>Apache Logs by Operating System \u2013 Overview<\/h4>\n<div id=\"attachment_20020\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/03\/View-Apache-Logs-By-Operating-System.png\" rel=\"attachment wp-att-20020\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-20020\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/03\/View-Apache-Logs-By-Operating-System.png\" sizes=\"auto, (max-width: 862px) 100vw, 862px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/03\/View-Apache-Logs-By-Operating-System.png 862w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/03\/View-Apache-Logs-By-Operating-System-768x900.png 768w\" alt=\"View Apache Logs By Operating System\" width=\"862\" height=\"1010\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">View Apache Logs By Operating System<\/p>\n<\/div>\n<h4>Apache Logs by Visitor Bandwidth \u2013 Overview<\/h4>\n<div id=\"attachment_20021\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/03\/View-Apache-Visitor-Bandwidth-Usage.png\" rel=\"attachment wp-att-20021\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-20021\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/03\/View-Apache-Visitor-Bandwidth-Usage.png\" sizes=\"auto, (max-width: 862px) 100vw, 862px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/03\/View-Apache-Visitor-Bandwidth-Usage.png 862w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/03\/View-Apache-Visitor-Bandwidth-Usage-768x900.png 768w\" alt=\"View Apache Visitor Bandwidth Usage\" width=\"862\" height=\"1010\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">View Apache Visitor Bandwidth Usage<\/p>\n<\/div>\n<h4>Apache Logs by Web Browser \u2013 Overview<\/h4>\n<div id=\"attachment_20022\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/03\/View-Apache-Usage-based-on-Browsers.png\" rel=\"attachment wp-att-20022\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-20022\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/03\/View-Apache-Usage-based-on-Browsers.png\" sizes=\"auto, (max-width: 862px) 100vw, 862px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/03\/View-Apache-Usage-based-on-Browsers.png 862w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/03\/View-Apache-Usage-based-on-Browsers-768x900.png 768w\" alt=\"View Apache Usage based on Browsers\" width=\"862\" height=\"1010\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">View Apache Usage based on Browsers<\/p>\n<\/div>\n<h3>How do I generate Apache HTML report?<\/h3>\n<p>To generate an HTML report of your Apache webserver logs, just run it against your web log file.<\/p>\n<pre># goaccess -f \/var\/log\/httpd\/access_log &gt; reports.html\r\n<\/pre>\n<div id=\"attachment_20023\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/03\/Monitor-Apache-Logs-via-Web-Browser.png\" rel=\"attachment wp-att-20023\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-20023\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/03\/Monitor-Apache-Logs-via-Web-Browser.png\" sizes=\"auto, (max-width: 994px) 100vw, 994px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/03\/Monitor-Apache-Logs-via-Web-Browser.png 994w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/03\/Monitor-Apache-Logs-via-Web-Browser-768x810.png 768w\" alt=\"Monitor Apache Logs Using Web Browser\" width=\"994\" height=\"1049\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">GoAccess: Monitor Apache Logs Using Web Browser<\/p>\n<\/div>\n<p>For more information and usage please visit\u00a0<a href=\"http:\/\/goaccess.io\/\" target=\"_blank\" rel=\"nofollow noopener\">http:\/\/goaccess.io\/<\/a>.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/goaccess-a-real-time-apache-and-nginx-web-server-log-analyzer\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>GoAccess\u00a0is an interactive and real time web server log analyzer program that quickly analyze and view web server logs. It comes as an open source and runs as a command line in Unix\/Linux operating systems. It provides brief and beneficial HTTP (web server) statistics report for Linux administrators on the fly. It also take care &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/15\/goaccess-a-real-time-apache-and-nginx-web-server-log-analyzer\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;GoAccess (A Real-Time Apache and Nginx) Web Server Log Analyzer&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-11705","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/11705","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=11705"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/11705\/revisions"}],"predecessor-version":[{"id":11706,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/11705\/revisions\/11706"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=11705"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=11705"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=11705"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}