Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Camilo E. Hidalgo Estevez <camilohe@gmail.com> based on
visitors <http://www.hping.org/visitors> by Salvatore
Sanfilippo <antirez@invece.org>.
Camilo E. Hidalgo Estevez <camilohe@gmail.com> based on
visitors <http://www.hping.org/visitors> by Salvatore
Sanfilippo <antirez@invece.org>.

Note that the major part of the source code was written by
Note that the major part of the source code was written by
Salvatore Sanfilippo.
6 changes: 3 additions & 3 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Under UNIX systems just type:

% make

Under WIN32 you need MINGW and MSYS (an easy way to get these and git
as a bonus is installing msysgit), then follow the above istructions.
Under WIN32 you need MINGW and MSYS (an easy way to get these and git
as a bonus is installing msysgit), then follow the above istructions.

For compilation problems please write an email to <camilohe@gmail.log>
with the exact problem, version of Visited, environment, GCC used, and so
Expand All @@ -22,7 +22,7 @@ on.
HOW TO HELP
-----------

Please send patches, I'll merge it, but be aware the project is now licensed
Please send patches, I'll merge it, but be aware the project is now licensed
under the BSD license, it's no longer GPLed.

THANKS TO ...
Expand Down
4 changes: 2 additions & 2 deletions SECURITY
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ in visitors. Currently no bug of this kind was reported or found.

VISITED CODE QUALITY AND AUDITING

Visited is tested with big log files to ensure that there aren't obvious
memory violation problems with normal log files, and is based on code written
Visited is tested with big log files to ensure that there aren't obvious
memory violation problems with normal log files, and is based on code written
with care about security.

POSSIBLE PROBLEMS
Expand Down
2 changes: 1 addition & 1 deletion blacklist.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (C) 2005 Salvatore Sanfilippo
*
* NOTE:
*
*
* This fail was obtained as a modification of the
* MT-Blacklist Master Copy, see
* http://www.jayallen.org/comment_spam/blacklist.txt
Expand Down
10 changes: 5 additions & 5 deletions doc.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@
<A HREF="#toc">Table of Contents</A><P>

<H2><A NAME="sect0" HREF="#toc0">Name</A></H2>
visitors - a fast web server log analyzer
visitors - a fast web server log analyzer
<H2><A NAME="sect1" HREF="#toc1">Synopsis</A></H2>
<B>visitors</B> [<I>options]
<I>&lt;filename&gt; [<I>&lt;filename&gt; ...]
<I>&lt;filename&gt; [<I>&lt;filename&gt; ...]
<H2><A NAME="sect2" HREF="#toc2"></I></I></I>Description</A></H2>
<P>
<I>Visitors</I> generates access statistics from
specified web log files. <P>
The resulting reports contain a number of useful
informations and statistics:
informations and statistics:
<DL>


Expand Down Expand Up @@ -650,7 +650,7 @@ <H2><A NAME="sect4" HREF="#toc4">Examples</A></H2>
% visitors
/var/log/apache/access.log.* <BR>
% zcat access.log.*.gz | visitors - <P>

<H2><A NAME="sect5" HREF="#toc5">Stream Mode Details</A></H2>
<P>
The usual way to run
Expand Down Expand Up @@ -688,7 +688,7 @@ <H2><A NAME="sect5" HREF="#toc5">Stream Mode Details</A></H2>
visitors --tail /var/log/apache/access.log | visitors --stream -A --update-every
30 --reset-every 3600 \<BR>
--output-file /tmp/report.html<BR>

<H2><A NAME="sect6" HREF="#toc6">Authors</A></H2>
<P>
<I>Visitors</I> was written by Salvatore Sanfilippo &lt;antirez@invece.org&gt;.
Expand Down
20 changes: 10 additions & 10 deletions iis2apache.pl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
$tzoffset = shift @ARGV if ($arg eq "--faketz");
$vhost = shift @ARGV if ($arg eq "--vhost");
$debug = 1 if ($arg eq "--debug"); # show field interpretation
}
}

if ($tzoffset eq "") {
print STDERR "Will use -0000 as a fake tzoffset\n";
Expand All @@ -31,7 +31,7 @@
}

# an IIS log adheres to what's defined by 'Fields;'
# attempt to parse this, tagging
# attempt to parse this, tagging


LINE:
Expand All @@ -40,7 +40,7 @@
if ($line =~ /^#Fields: /) {
@line = split(" ", $line);
shift @line; # shifts of #Fields
# build a hash so we can look up a fieldname and
# build a hash so we can look up a fieldname and
# have it return a position in the string
undef %fieldh;
$n = 0; # zero-based array for split
Expand All @@ -53,10 +53,10 @@
next LINE if ($line =~ /^#/);

#Fields: date time c-ip cs-username s-sitename s-computername s-ip cs-method cs-
#uri-stem cs-uri-query sc-status sc-win32-status sc-bytes cs-bytes time-taken
#uri-stem cs-uri-query sc-status sc-win32-status sc-bytes cs-bytes time-taken
#s-port cs-version cs(User-Agent) cs(Cookie) cs(Referer)

# this is really slow.
# this is really slow.

$date = yankfield("date");
$time = yankfield("time");
Expand All @@ -67,9 +67,9 @@
$query = yankfield("cs-uri-query");
$status = yankfield("sc-status");
#$bytes = yankfield("cs-bytes");
# Which is it? sc-bytes or cs-bytes?
# Which is it? sc-bytes or cs-bytes?
# cs-bytes only appears in some of the IIS logs I've seen.
# I'll assume that sc-bytes is "server->client bytes", which
# I'll assume that sc-bytes is "server->client bytes", which
# is what we want anyway.
$bytes = yankfield("sc-bytes"); # I'm gonna go with this.
$useragent = yankfield("cs(User-Agent)");
Expand All @@ -80,7 +80,7 @@
# our modified CLF sez:
# IP - - [DD/MMM/YYYY:HH:MM:SS TZOFFSET] "method stem[?query]" status bytes "referer" "user agent" "vhost"

# convert date
# convert date
# 2000-07-19 00:00:01
($y, $m, $d) = split("-", $date);
$m =~ s/^0//g;
Expand All @@ -98,7 +98,7 @@


# return the proper field, or "-" if it's not defined.
# (unfortunately ($date) = (split(" ", $line))[$fieldh{date}];
# (unfortunately ($date) = (split(" ", $line))[$fieldh{date}];
# will return element 0 if $fieldh{date} is undefined . . .)

sub yankfield {
Expand All @@ -112,5 +112,5 @@ sub yankfield {
print STDERR "$field undefined\n" if ($debug);
return "-";
}
}
}

2 changes: 1 addition & 1 deletion tail.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void vi_tail(int filec, char **filev)
{
long *len;
int i;

if (filec <= 0) {
fprintf(stderr, "No files specified in tail-mode\n");
exit(1);
Expand Down
4 changes: 2 additions & 2 deletions visited.1
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Note that logfile can be a \- character to use the standard input.
.BI "\-A \-\-all"
Activate all the optional reports. This option is equivalent to
.B -GKUWRDOB.
Note that
Note that
.B --trails
is not implicitly included in this option because it also requires
.B --prefix.
Expand Down Expand Up @@ -191,7 +191,7 @@ you can find in the README file in the visitors tarball.
.PP
.TP 8
.BI "\-\-stream"
Enable the Stream Mode (see the
Enable the Stream Mode (see the
.B STREAM MODE DETAILS
section for more information). Shortly: when in stream mode
.I Visitors
Expand Down
24 changes: 12 additions & 12 deletions visited.c
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,7 @@ void vi_process_month_and_day(struct vih *vih, int month, int day, long size) {
}

/* Process requests populating the pages and sites hash tables.
* Populate also date and month hash tables if requested
* Populate also date and month hash tables if requested
* Return non-zero on out of memory. */
int vi_process_requests(struct vih *vih, char *req, long size, char *date) {
char *p, *site = NULL, *month = "fixme if I'm here!";
Expand Down Expand Up @@ -1152,7 +1152,7 @@ int vi_process_requests(struct vih *vih, char *req, long size, char *date) {
if (res == 0) return 1;
res = vi_counter_incr(&vih->sites_hits, site);
if (res == 0) return 1;
// restore url to avoid interfering with functions called after this
// restore url to avoid interfering with functions called after this
*p = '/';
}
}
Expand Down Expand Up @@ -1192,12 +1192,12 @@ int vi_process_types(struct vih *vih, char *url, long size) {
p++;
}
if (!*p) return 0;
// get the last "." position
// get the last "." position
dot = strrchr(p, '.');
// if no dot found, assume no file type given and exit
// if no dot found, assume no file type given and exit
if (!dot) return 0;

// find file type end by searching the first non digit/alpha char after dot
// find file type end by searching the first non digit/alpha char after dot
p = dot+1;
while (*p && isalnum(*p)) {
if (isalpha(*p))
Expand All @@ -1206,7 +1206,7 @@ int vi_process_types(struct vih *vih, char *url, long size) {
}
if (*p) // we found a non digit/alpha so set to null to end file type string
*p = '\0';

res = vi_counter_incr(&vih->types_hits, dot);
if (res == 0) return 1;
res = vi_traffic_incr(&vih->types_size, dot, size);
Expand Down Expand Up @@ -1410,7 +1410,7 @@ int vi_process_line(struct vih *vih, char *l) {

/* The following are processed only for new visits */
if (seen) return 0;

return 0;
} else {
vih->invalid++;
Expand Down Expand Up @@ -1797,7 +1797,7 @@ void om_html_print_keykey_entry(FILE *fp, char *key1, char *key2, int num) {
fprintf(fp, "<td align=\"left\" class=\"valueentry\">");
om_html_entities(fp, key1);
fprintf(fp, "</td><td align=\"left\" class=\"keyentry\">");

if (strncmp(key2, "http://", 7) || !strncmp(key2, "https://", 8) || !strncmp(key2, "ftp://", 6)) {
fprintf(fp, "<a class=\"url\" href=\"%s\">", key2);
om_html_entities(fp, key2);
Expand Down Expand Up @@ -2564,7 +2564,7 @@ void vi_print_monthday_map_report(FILE *fp, struct vih *vih) {
/* do sizes now */
md = (int*) vih->monthday_size;
minj = 0, maxj = 0;

/* Check indexes of minimum and maximum in the array. */
for (j = 0; j < 12*31; j++) {
if (md[j] > md[maxj])
Expand Down Expand Up @@ -2627,7 +2627,7 @@ int vi_print_report(char *of, struct vih *vih) {
vi_print_hline(fp);
vi_print_report_links(fp);
vi_print_hline(fp);

vi_print_pages_report(fp, vih);
vi_print_hline(fp);
if (Config_process_sites) {
Expand Down Expand Up @@ -2658,12 +2658,12 @@ int vi_print_report(char *of, struct vih *vih) {
vi_print_error404_report(fp, vih);
vi_print_hline(fp);
}

vi_print_weekdays_report(fp, vih);
vi_print_hline(fp);
vi_print_hours_report(fp, vih);
vi_print_hline(fp);

vi_print_hits_report(fp, vih);
vi_print_hline(fp);

Expand Down