Current User: Guest Login
Please consider registering


Lost Your Password?

Search Forums:


 






Minimum search word length is 4 characters – Maximum search word length is 84 characters
Wildcard Usage:
*  matches any number of characters    %  matches exactly one character

Awstats issue with Tomcat log format

Reply to Post Add a New Topic
UserPost

11:14 am
January 9, 2012


Umesh

Guest

Hello,

 

    I am tring to configure awstas with tomcat . Whenever i am trying to update the database i ma getting following error .

 

      Create/Update database for config "/etc/awstats/awstats.tomcat.conf" by AWStats version 6.95 (build 1.943)
From data in log file "/var/log/Tomcat_log/localhost_access_log.2012-01-09.03.txt"…
Phase 1 : First bypass old records, searching new record…
Searching new records from beginning of log file…
AWStats did not find any valid log lines that match your LogFormat parameter, in the 50th first non commented lines read of your log.
Your log file /var/log/Tomcat_log/localhost_access_log.2012-01-09.03.txt must have a bad format or LogFormat parameter setup does not match this format.
Your AWStats LogFormat parameter is:
1
This means each line in your web server log file need to have "combined log format" like this:
111.22.33.44 – - [10/Jan/2001:02:14:14 +0200] "GET / HTTP/1.1" 200 1234 "http://www.fromserver.com/from.htm" "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"
And this is an example of records AWStats found in your log file (the record number 50 in your log):
94.76.209.6 [09/Jan/2012:03:23:54 +0000] [200 168 15] POST /win-smsgwweb/winmt HTTP/1.1
Setup ('/etc/awstats/awstats.tomcat.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).

    Please help me .

 

Regards,

Umesh

12:02 pm
January 9, 2012


Jean-Luc

Admin

posts 1125

Hello,

It seems that the LogFormat directive in your AWStats config file does not match the LogFormat directive of your web server. Please paste both directives here for further help.

12:55 pm
January 9, 2012


Umesh

Guest

Thanks Jean-Luc for reply

 

1)   Tomcat Sample Log :

 

    10.0.0.210 [09/Jan/2012:17:12:09 +0530] 304 – 0 GET /docs/images/printer.gif HTTP/1.1

 

    server.xml – log format – <Valve className="org.apache.catalina.valves.AccessLogValve"
                   directory="logs" prefix="localhost_access_log." suffix=".txt"
                   fileDateFormat="yyyy-MM-dd.HH" pattern="%a %t %s %b %D %r" resolveHosts="false" />

 

2) In awstats config file i use LogFormat=1

 

      Might be for this reasome it is throughing the error .  Could you please let me know the format i have to put in that  config file

 

Regards,

Umesh

 


1:04 pm
January 9, 2012


Jean-Luc

Admin

posts 1125

I will try to guess from the log file samples. Try this as AWStats LogFormat:

LogFormat = "%host %time1 %code %bytesd %other %method %url %other"

This is obviously far from ideal as your log file does not contain referrers and user agents. This could be changed in your web server setup.

1:40 pm
January 9, 2012


Umesh

Guest

Thanks it works for me . I am want to use Response time so i changed the log format as followes :

 

LogFormat = "%host %time1 %code %bytesd %extra1 %method %url %other"

 

It showes as

 

Parsed lines in file: 111
 Found 0 dropped records,
 Found 0 corrupted records,
 Found 0 old records,
 Found 111 new qualified records.

     But in i check in browser it doesnt show any valid records .

 

Regards,

Umesh

1:51 pm
January 9, 2012


Jean-Luc

Admin

posts 1125

AWStats sections reporting browsers, operating systems, keywords and referers cannot work because of your log format. You can disable the robots detection in the AWStats config file with

LevelForRobotsDetection=0

2:22 pm
January 9, 2012


Umesh

Guest

Hi

  How i enable all the records like

 reporting browsers, operating systems, keywords and referers

 Regards,

Umesh

2:51 pm
January 9, 2012


Umesh

Guest

Hi

     In browser it showes "Not viewed traffic" what does it means

 Regards,

Umesh

5:40 am
January 10, 2012


Umesh

Guest

HI Jean-Luc,

     Could you please let me know how i will get all the data with response time in awstats console .

 Regards,

umesh

9:21 pm
January 10, 2012


Jean-Luc

Admin

posts 1125

Hi Umesh,

So you had 111 new qualified records. Do you mean that these 111 hits are reported as "not viewed traffic" ? In a typical environment, you should have more "viewed traffic" than "not viewed traffic". After the first AWStats data update, the total should be close to the number of qualified records. How many hits do you find in the "HTTP Status Codes" section ?

When repeating tests on a new configuration, always start a new test with an empty DirData directory.

To get browsers, operating systems, keywords and referrers in the reports, you need to change the Tomcat log file format. You should use what Apache calls "combined log format". I do not know how you set this up in Tomcat.

Regarding the reporting about response times, AWStats is not very good at that. If you are not experienced with AWStats, don't try to use it for response time statistics (sorry, but I don't have any better honest answer).

11:36 am
January 16, 2012


Umesh

Guest

hahah 🙂

 

I am getting all the details expect Operating system . Here is the logformat and some sample log .

 

LogFormat = "%host %time1 %code %bytesd %extra1 %method %url %other %ua"

 

Log :———–

 

127.0.0.1 [12/Jan/2012:15:56:19 +0530] 304 – 15 GET /win-smsgwweb/test.html HTTP/1.1 Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; BTRS26718; GTB7.2)
127.0.0.1 [12/Jan/2012:15:56:19 +0530] 304 – 0 GET /win-smsgwweb/test.html HTTP/1.1 Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; BTRS26718; GTB7.2)

 

            Please help me to resolve this problem.

 

Regards,

Umesh

1:32 pm
January 16, 2012


Jean-Luc

Admin

posts 1125

Hi,

The data in the sections about operating systems and user agents come all from the %ua field. It is weird that you get a correct user agent section and that the operating system section is not okay.

Check that you have this line in the config file:

ShowOSStats=1

12:00 pm
January 17, 2012


umesh

Guest

Hi,

 

    Thanks For the reply .

 

     I checked the configuration file and "ShowOSStats=1" enabled .

     Do you have any other guess ?

 

Regards,

Umesh

9:50 am
January 18, 2012


umesh

Guest

HI ,

 Here I am pasting the Logfile and Logfile format . Please cross check once . I am getting all the details except Operating system . And All mozila browser requests ,   awsts shows that request came from  Netscape Browser .

 

LogFormat="%host %time1 %code %bytesd %extra1 %method %url %other %ua"

 

127.0.0.1 [17/Jan/2012:18:17:43 +0530] 304 – 16 GET /win-smsgwweb/test1.html HTTP/1.1 Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; BTRS26718; GTB7.2)
127.0.0.1 [17/Jan/2012:18:17:43 +0530] 304 – 0 GET /win-smsgwweb/test1.html HTTP/1.1 Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; BTRS26718; GTB7.2)
127.0.0.1 [17/Jan/2012:18:17:43 +0530] 304 – 0 GET /win-smsgwweb/test1.html HTTP/1.1 Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; BTRS26718; GTB7.2)

 

 Regards,

Umesh

10:32 am
January 18, 2012


Jean-Luc

Admin

posts 1125

Hi Umesh,

The user agent in the log file is not in an acceptable format. It should be either like this (%ua)

Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+BTRS26718;+GTB7.2)

or like this (%uaquot)

"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; BTRS26718; GTB7.2)"

 

If there are no double quotes around the user agent, the spaces that it contains must be replaced by + signs, otherwise AWStats has no way to know when the user agent field ends.

4:39 am
January 19, 2012


umesh

Guest

Thanks .

 

       After changing the logformat it works .

 

      Once again Many Many Thanks 🙂

 

Regards,

Umesh

3:47 pm
March 25, 2020


Sagar

Guest

Post Awaiting Approval by Forum Administrator

Reply to Post

Reply to Topic:
Awstats issue with Tomcat log format

Guest Name (Required):

Guest Email (Required):

NOTE: New Posts are subject to administrator approval before being displayed

Smileys
Confused Cool Cry Embarassed Frown Kiss Laugh Smile Surprised Wink Yell
Post New Reply

Guest URL (required)

Math Required!
What is the sum of:
6 + 7
   


About the InternetOfficer.com Forum

Forum Timezone: UTC 1

Most Users Ever Online: 302

Currently Online:
12 Guests

Currently Browsing this Topic:
1 Guest

Forum Stats:

Groups: 2
Forums: 9
Topics: 639
Posts: 2710

Membership:

There are 257 Members
There have been 304 Guests

There is 1 Admin
There is 1 Moderator

Top Posters:

cssfsu – 55
deepakgupta – 34
albert_newton – 30
cosminpana – 20
DTNMike – 19
ahtshun83 – 17

Recent New Members: raju, todd2taylor, sbdcunha, mansigill1987, ThomasDuh, ThomasKic

Administrators: Jean-Luc (1125 Posts)

Moderators: Jean-Luc (1125 Posts)