VISITORS(1)
π¦ VISITORS(1) β General Commands Manual π¦
okay bestie, buckle up, because this is the manpage for visitors, and it's genuinely one of the most underrated little tools out there. it's a fast web server log analyzer and it's about to make your logs make sense. no cap. π
β¨ NAME β¨
visitors β a fast web server log analyzer π
β¨ SYNOPSIS β¨
visitors [options] <filename> [<filename> ...]
β¨ DESCRIPTION β¨
so basically, visitors generates access statistics from whatever web log files you hand it. like, you point it at your logs and it goes off and produces the whole report card. π
the resulting reports contain a bunch of genuinely useful info and statistics, and here's the full list because we do not skip anything in this house:
- Requested pages π
- Requested images πΌοΈ
- Referers by number of visits and age π
- Unique visitors in each day π₯
- Page views per visit π
- Pages accessed by the Google crawler (plus the date of google's last access on every page) π€
- Pages accessed by the AdSense crawler (plus the date of adsense's last access on every page) π°
- Percentage of visits originated from Google searches for every day π
- User navigation patterns (web trails) πΎ
- Keyphrases used in Google searches β¨οΈ
- Human languages used in google searches π
- User agents π΅οΈ
- Weekdays and Hours distributions of accesses π
- Weekdays/Hours combined bidimensional map πΊοΈ
- Month/Day combined bidimensional map π
- Visual path analysis with Graphviz π¨
- Operating systems, browsers and domains popularity π
- Visitors screen resolution and color depth π₯οΈ
- 404 errors π
now, the web log files don't need to follow some strict rigid format, which is honestly so slay of them. except β and this part is non-negotiable, bestie:
- the date MUST be included between
[and]chars - the client hostname MUST be the first entry in the log
- referers and requests MUST be included between double quote chars
out of the box Apache log files will just work, no problems, no drama. π«Ά
it's also possible to use Visitors with IIS log files β you just convert them first using the iis2apache.pl utility distributed with Visitors. (that utility is the same one you can find at http://www.jammed.com/~jwa/hacks/ and it's distributed under the GPL license, fyi.)
π note thatlogfilecan be a-character to use the standard input. yes, that's a real feature, and yes, it's giving piping energy.
β¨ Available options: β¨
-A,--allβ activates all the optional reports. this option is equivalent to-GKUWRDOB. but lowkey important:--trailsis not implicitly included in this option because it also requires--prefix. see the--trailsoption documentation for the details, bestie. π-T,--trailsβ enables the Web Trails feature. the report shows what the more frequent moves between pages of your site are (like, the actual paths people take). this option requires the--prefixoption to work. πΎ-G,--googleβ activates two reports about pages accessed by the Google and Adsense web crawlers. pages are shown ordered according to the last time the Google web crawler requested the page. the first page shown is the latest that was accessed. π€-K,--google-keyphrasesβ activates a report showing common search keyphrases used to found your web site from Google. π-Z,--google-keyphrases-ageβ activates a report showing common the latest keyphrases used to found your site from Google. β³-H,--google-human-languageβ activates a report showing common human languages used to search from Google. this feature uses the'hl'variable of the Google referer URL. π-U,--user-agentsβ show information about common user agents. π΅οΈ-W,--weekday-hour-mapβ activates the generation of a combined weekdays/hours bidimensional map, showing info about traffic in every 168 different hours of a 7 days week. brighter colors mean higher traffic. this is ideal for figuring out the best moment on a week for a maintenance downtime, what the target of the site is, whether people are accessing it from work or from home, and so on. the map is generated as pure html inside the report. πΊοΈ-M,--month-day-mapβ activates the generation of a combined month/day bidimensional map, showing info about traffic in every 365 different days of the year. brighter colors mean higher traffic. this is useful to figure out, with a quick look, traffic trends and days with particularly high or low traffic. the map is generated as pure html inside the report. π-R,--referers-ageβ shows referers ordered by age. the'age'of a referer is the date it appeared the first time. in the report, newer referers are on top. this report is useful to check for new external links. π-D,--domainsβ activates the generation of info about Top Level Domains popularity. this info may be useful to guess the amount of visits from different countries. note that Visitors will not resolve numerical IP addresses if they're not already resolved in the log file β all the unresolved IP addresses will be shown in this report under the entryUnresolved IP. π-O,--operating-systemsβ activates the report about Operating Systems popularity, sorted by number of accesses. all the common operating systems are listed in the report, while unknown operating systems get summed into theunknownentry. π§-B,--browsersβ activates the report about Browsers popularity, sorted by number of accesses. all the common browsers are listed, while unknown browsers get summed into theunknownentry. browsers are listed by family (for example Internet Explorer, Opera, and so on), and not by specific version. π-X,--error404β activates the generation of the missing documents (404 error) report. this shows files requested but missing, ordered by number of requests. it's useful to discover if, for some mistake, there's some file missing in the web site β but honestly you'll often see bizarre requests performed by users or internet worms and security scans. π-Y,--pageviewsβ activates the generation of a report showing (an approximation of) the percentage of pages viewed per unique visit. the goal here is to understand the usage pattern of the site and the level of interest of the visitors. for example, in a site that provides a number of pages with interesting contents, the percentage of visitors performing a single page view per visit is probably searching for something else. π-S,--robotsβ activates the generation of a report showing user agents of clients requesting the filerobots.txt, with the exception of the MSIE Crawler requests. the result is a list of web robots and spieders that accessed your web site, ordered by number of requests ofrobots.txt. π·οΈ--screen-infoβ activates the screen resolution and color depth reports. β οΈ note that for this report to work you have to insert on your HTML pages the javascript code you can find in theREADMEfile in the visitors tarball. π₯οΈ--streamβ enables the Stream Mode (see the STREAM MODE DETAILS section for more info). shortly: when in stream mode Visitors will process all the log files specified (possibly none β that's valid in this mode) as usual, producing the report. then the stream mode is entered and Visitors starts to read from standard input for a continuous stream of web logs, updating the statistics incrementally as new data is available. a new report is produced periodically if new data arrived, according to the--update-everyoption (default is to update the statistics every ten minutes). it's possible to ask Visitors to reset the statistics after some period of time using the--reset-everyoption β this allows you to have a snapshot of what's going on in the last five minutes, hour, day or week. π
π¨ note that--streamrequires--output-filebecause Visitors needs to overwrite the report for every update, so it can't output to standard output as usual. if you plan to use the stream mode, also check the--tailoption.
--update-everyseconds β by default in Stream Mode statistics are updated every 10 minutes. this option specifies a different period in seconds. β±οΈ--reset-everyseconds β by default in Stream Mode statistics are never reset, but continuously updated incrementally. this option specifies to reset statistics after the given amount of time in seconds. useful to have a snapshot of the web site usage. π-f,--output-filefile β write output to file instead of stdout. π-m,--max-linesnumber β set the max number of entries that should be shown in reports like referers, keyphrases and so on. this option sets all the reports max number of entries for all the reports at once. β¨-r,--max-referersnumber β set the max number of entries in the referer report. π-p,--max-pagesnumber β set the max number of entries in the accessed pages report. π-i,--max-imagesnumber β set the max number of entries in the accessed images report. πΌοΈ-x,--max-error404number β set the max number of entries in the missing documents report. π-u,--max-useragentsnumber β set the max number of entries in the user agents report. π΅οΈ-t,--max-trailsnumber β set the max number of entries in the web trails report. πΎ-g,--max-googlednumber β set the max number of entries in the crawled pages report (google bot). π€--max-adsensednumber β set the max number of entries in the crawled pages report (adsense bot). π°-k,--max-google-keyphrasesnumber β set the max number of entries in the Google keyphrases report. β¨οΈ-a,--max-referers-agenumber β set the max number of entries in the referers by date report. β³-d,--max-domainsnumber β set the max number of entries in the domains report. π-P,--prefixstring β prefixes specify to visitors how a link should look like to be classified as internal to your site. this option is required for--trails, and will also have the nice effect of avoiding internal links being shown in the referers report. if you're analyzing statistics forhttp://www.your.site.com/, just use:
--prefix http://www.your.site.com
if your site is reachable using more hostnames you should specify all these, like in the following example:
--prefix http://www.your.site.com --prefix http://your.site.com
ππ
-o,--outputhtml|textβ output module. you can usetextorhtml. the default ishtml. π
(( part 2 is coming, don't go anywhere bestie )) πΈ
-V,--graphvizβ bestie, this turns on Graphviz mode β¨ Visitors analyzes the log file and builds a graph describing your websiteβs access patterns. The info used is the same as the web trails report (which you can turn on with--trails), but as a graph it can be way more readable for nontrivial sites. Example of how to use it:
% visitors access.log --prefix http://www.hping.org \
--graphviz > graph.dot
% dot /tmp/graph.dot -Tpng > graph.png
On Debian systems, the dot command is included in the graphviz package. The generated graph has edges of different colors, from blue to red, to show a low-to-high level of popularity for a given movement from one page to another of the website. This option requires one or more --prefix options in order to work, just like the --trails option. π
-V,--graphviz-ignorenode-googleβ donβt put the google node on the generated graph. Only useful with--trails.-V,--graphviz-ignorenode-externalβ donβt put the external referer node on the generated graph. Only useful with--trails.-V,--graphviz-ignorenode-norefererβ donβt put the node indicating requests without referer on the generated graph. Only useful with--trails.--tailβ when this option is specified, Visitors emulates the Unix commandtail -f --max-unchanged-stats=1 -q. You can specify the log file names to monitor for changes; once new data is appended in any of the specified files, Visitors outputs the new data to standard output. This option is useful together with Stream Mode (--stream). Files can be log-rotated because Visitors in Tail Mode will always try to reopen the file to check for changes. π¦--time-deltadelta β if your web server is in a different timezone than most of your visitors or yourself, youβll notice a shift in the reports regarding time and days of week. By default, Visitors generates output using the hostβs locale. You can use--time-deltato adjust the output. Positive values shift right (toward the future) by the given number of hours; negative values shift left (toward the past). In the future this option may support directly specifying the output timezone.--filter-spamβ filters referer spam using a keyword-based filter (seeblacklist.hfor more information on keywords). If you donβt know what referer spam is, check this Wikipedia page:http://en.wikipedia.org/wiki/Referer_spam.--ignore-404β when this option is turned on, log lines with 404 errors are just used to generate the 404 errors report and not used for other reports.--greppattern β process only log lines matching the specified pattern. Patterns are matched using glob-style matching (the one used by the Unix shell):*β matches any sequence of characters in string, including a null string.?β matches any single character in string.[chars]β matches any character in the set given by chars. If a sequence of the formx-yappears in chars, then any character betweenxandy, inclusive, will match.\xβ matches the single characterx. This provides a way of avoiding the special interpretation of the characters*?[]\in pattern.
By default, matching is performed in a case-sensitive way, but case-insensitive matching may be forced by prefixing the pattern with the string cs:, so for example the pattern cs:firefox will match all the log lines containing the string firefox, FireFox, FIREFOX and so on. π
--excludepattern β works exactly like--grep, but only lines NOT matching the specified pattern are processed. Note that--grepand--excludecan be used multiple times, and are processed sequentially. For example,visitors --grep firefox --exclude downloadwill process only lines including the stringfirefoxbut not including the stringdownload.--debugβ show additional information on errors. For example, invalid lines are printed on the standard error if found. Mainly useful for developers and error reporting.-h,--helpβ show usage and copyright information.-v,--versionβ show program version.
π EXAMPLES π
The simplest usage β perfect for checking a web log interactively (for example over ssh on your web server) β is just:
% visitors access.log | less
That produces a human-readable output in text only. To generate HTML web stats with much more information, you may use this instead:
% visitors --output text -A -m 30 access.log -o html > report.html
If you want information on the usage patterns for your site, you must provide the URL prefix of your website and specify the --trails option. The next example produces an HTML report with usage patterns information.
% visitors -A -m 30 access.log --trails \
--prefix http://www.hping.org > report.html
Note that itβs okay to specify multiple file names, or to provide the input using standard input, like in the following two examples:
% visitors /var/log/apache/access.log.*
% zcat access.log.*.gz | visitors -
π STREAM MODE DETAILS π
The usual way to run Visitors is to specify some option to control the report generation, and the name of log files. For example, to generate a report from two Apache access log files you can write:
% visitors -A access.log.1 access.log.2 > report.html
Visitors analyzes the log files and outputs the report. Sometimes it can be more interesting to have web statistics updated continuously, almost in real time, as new data becomes available. To provide this feature, Visitors implements a mode called Stream Mode that reads a stream of logs from standard input. The following command line shows how to use it (but check the --stream option documentation for more information).
% tail -f /var/log/apache/access.log | \
visitors --stream -A --update-every 60 \
--output-file /tmp/report.html
Visitors incrementally updates the statistics as new logs become available and updates the HTML report every 60 seconds. As you can see, in this mode youβre required to specify the report file name using the --output-file option because Visitors needs to overwrite the report to update it. Note that instead of the tail command in the above example, itβs possible to use Visitors in Tail Mode instead (an emulation for the tail program):
% visitors --tail /var/log/apache/access.log | \
visitors --stream -A --update-every 60 \
--output-file /tmp/report.html
Itβs possible to generate real-time statistics about the last N seconds of web traffic, where N is configurable and can be from a few seconds to one week or more, using the --reset-every option. The following example generates statistics updated every 30 seconds about the last hour of traffic:
% visitors --tail /var/log/apache/access.log | \
visitors --stream -A --update-every 30 --reset-every 3600 \
--output-file /tmp/report.html
π AUTHORS π
Visitors was written by Salvatore Sanfilippo <antirez@invece.org>.
π§ COPYING π§
Copyright (C) 2004,2005 Salvatore Sanfilippo <antirez@invece.org>.
Visitors is distributed under the GNU General Public License.
This manual page was written (based on the original HTML documentation) by Romain Francoise <rfrancoise@debian.org> for the Debian GNU/Linux system, but may be used by others. Salvatore Sanfilippo updated this man page starting from Visitors 0.5; this manual page is now part of the Visitors tarball.
okay bestie, thatβs the whole vibe check β
this page is Visitors 0.7, dated April 2005, and itβs page VISITORS(1) β iconic, fr fr π
π¦ where this page comes from
- arch rolling: visitors 0.7-9 Β· GPL-2.0-only AND custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms