Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install and use goaccess

2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "how to install and use goaccess", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to install and use goaccess" this article.

1. Install goaccess under Debian

Cat / etc/debian_version

6.0.10

Apt-cache search goaccess

Goaccess-log analyzer and interactive viewer for the Apache Webserver

Apt-get-y install goaccess

2. Install goaccess under Centos

Cat / etc/redhat-release

CentOS release 6.6 (Final)

Yum list | grep goaccess

Goaccess.x86_64 0.8.5-1.el6 epel

Yum-y install goaccess

If there is no epel source, you need to install

Rpm-Uvh http://mirrors.sohu.com/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm

Third, parameter description

-b Enable total bandwidth consumption. To achieve faster parsing

Do not enable this flag. This has been disabled by default. (traffic statistics)

-f input-file path to input log filename (log file name)

-s Enable/report HTTP status codes. To avoid overhead while parsing

This has been disabled by default. (HTTP response code statistics)

-e Exclude an IP from being count it under the HOST module.

This has been disabled by default. (specify IP address statistics, which is disabled by default) specify or exclude?

-c Prompt log/date configuration window. (configuration)

-an Enable a List of User-Agents by host. (user agent statistics)

Fourth, function description

1. General Statistics (Statistical Overview, Traffic consumption)

Number of valid requests, number of invalid requests, time to analyze the data

Unique visitors, unique requested files, unique static files (css, ico, jpg

Js, swf, gif, png) unique HTTP referrers (URLs), unique 404s (not found)

Size of the parsed log file, bandwidth consumption.

2. Unique visitors (ranking of visitors)

HTTP requests having the same IP, same date and same agent will be considered a

Unique visit. This includes crawlers.

3. Requested files (dynamic Web request)

Hit totals are based on total requests. This module will display hits, percent

Bandwidth [time served], [protocol] and [method].

4. Requested static files (static web requests, such as pictures, style sheets, scripts, etc.)

Hit totals are based on total requests. Includes files such as: jpg, css, swf, js

Gif, png etc.

This module will display hits,percent,bandwidth, [time served], [protocol] and [method].

5. 404 or Not Found (404 error)

Hit totals are based on total requests. This module will display hits, percent

Bandwidth, [time served], [protocol] and [method].

6. Operating Systems (operating system)

Hit totals are based on unique visitors. This module will display hits and percent.

The expanded module shows all available versions of the parent node.

7. Browsers (browser and search engine)

Hit totals are based on unique visitors. This module will display hits and percent.

The expanded module shows all available versions of the parent node.

8. HTTP Status Codes (HTTP response code)

The values of the numeric status code to HTTP requests.

Hit totals are based on total requests. This module will display hits and percent.

9. Keyphrases (keyboard layout)

This module will report keyphrases used on Google search, Google cache

And Google translate. Hit totals are based on total requests. This module will dis-

Play hits and percent.

-f-Log file name

-b-enable traffic statistics. This parameter is not recommended if you want to speed up the analysis.

-s-enable HTTP response code statistics

-a-enable user agent statistics

-e-enables the specified IP address statistics. It is disabled by default.

-p-specifies the path to the goacces user profile

F1 help menu

F5 Refresh

Q exit the current window, menu, or currently viewed option

O Open current options, menus

C change the window color (currently there are only two default and green)

SHIFT + TAB switches backwards from the currently selected module

RIGHT opens the currently selected module to view details

S is sorted by date and will only work in the access request module

S, sorted by the number of clicks, only works in the access request module

/ window to view details to search

N after searching through /, find the location of the next match, and if not, display "search hit BOTTOM" at the bottom of the window.

T in the view details window, move the pointer to the top

B in the view details window, move the pointer to the bottom

Apache-what is?-how in goaccess

% v-vhost -% ^ ignore it

% h-host -% h

% l-hyphen -% ^ ignore it

% u-user -% ^ ignore it

% t-timestamp-[% dvl t% ^] ignore the zone from apache log

% r-request -% r

% s-status -% s

% b-size -% b

% {referer} I-request header -% R

% {UAgent} I-user agent -% u

% d date field matching the date_format variable.

% h host (the client IP address, either IPv4 or IPv6) IT net, http://www.it.net.cn

% r The request line from the client. This requires specific delimiters around the request (as single quotes, double quotes, or anything else) to be parsable. If not, we

Have to use a combination of special format specifiers as% m% U% H.

% m The request method.

% U The URL path requested (including any query string).

% H The request protocol.

% s The status code that the server sends back to the client. IT net, http://www.it.net.cn

% b The size of the object returned to the client.

% R The "Referrer" HTTP request header.

% u The user-agent HTTP request header. Linux Learning, http:// linux.it.net.cn

% D The time taken to serve the request, in microseconds.

% T The time taken to serve the request, in seconds or milliseconds. Note:% D will take priority over% T if both are used.

% ^ Ignore this field. Lin

Date_format See http://linux.die.net/man/3/strftime

Start log analysis and export to a html file:

one

[root@Rootop ~] # goaccess-f / home/wwwlogs/www.rootop.org.log-- log-format='%h% ^ [% d:% ^] "% r"% s% b "% R"% u "--date-format='%d/%b/%Y'-d-a > test.html

Or

[root@Rootop] # goaccess-f / home/wwwlogs/www.rootop.org.log-d-a-p / .goaccessrc > test2.html

Use bash/sed/awk to manually find Nginx logs # find time periods sed-n "/ 14//Jul//2015:00:00:00/ by date / 15//Jul//2015:15:00:00/ "p access.log > time_access.log# find the pages and number of errors awk'($9 ~ / 504 /) 'time_access.log | awk' {print $7}'| sort | uniq-c | sort-rn > 504.log# find the top 20 IP visits and the number of visits awk'{print $1} 'time_access.log | sort | uniq-c | sort-n-k 1-r | head -n 20 > top.log is all the content of the article "how to install and use goaccess" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report