Current User: Guest Login Register
Please consider registering


Register? | Lost Your Password?

Search Forums:


 






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

AWStats won't recognize %logname (cs-username) field

Reply to Post Add a New Topic
UserPost

10:49 am
March 23, 2009


thushanl

Member

posts 3

Hello,

I have installed AWStats on my PC to analyse our web server logs which hosts the web-frontend to a data warehouse. The web server in use is IIS v6. After playing around with the AWStats config file I have managed to generate the stats database as well as the HTML reports. However no matter what LogFormat string I use, AWStats just won't recognize the %logname field.

Please note that my logs do not have the sc-bytes/bytesd field so I'm substituting the sc-win32-status field for sc-bytes.

This is the format of my IIS log:

date time s-sitename s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status

These are the LogFormat strings I've tried using iin my config file

date time s-sitename s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-bytes

%time2 %other %host %method %url %other %other %lognamequot %host %ua %code %other %bytesd

Neither of these worked!

Here is a sample extract from a log file

2008-12-17 09:19:42 W3SVC1 172.16.11.181
 POST /msadc/msadcs.dll/SPHCSrv2.HyperCu
be.GetDimSchema – 80 mydomain\\john.doe 1
1.212.230.8 ACTIVEDATA 200 0 0

(some data has been anonymised)

I tried removing the domain name so that the logname field simply showed john.doe, I then tried using double quotes and using lognamequot. None of these approaches work! Also I've set DNSLookup=0 in the config file. So, from what I understand, AWStats is forced to use the user name…but it won't!

AWStats simply picks up the IP address and shows this in the “hosts” section of the report. I want it to use the actual, authenticated user name instead since everyone accessing our website must have a user name.

Thanks!

12:31 pm
March 23, 2009


Jean-Luc

Admin

posts 1063

Hi,

I would try :

LogFormat="%time2 %other %other %method %url %query %other %host %other %ua %code %other %bytesd"

Notes :

  • %host  shoud not be used for s-ip
  • %lognamequot  should only be used when the log name is between quotes
  • if you want that AWStats uses the log name in place of the host address, use %host  for the log name
  • your user agent value (ACTIVEDATA, in your example) is not standard.  Not sure whether AWStats will identify it as a regular browser or as a robot.

4:36 am
March 24, 2009


thushanl

Member

posts 3

Thanks Jean-Luc, your LogFormat string worked perfectly. It never occurred to me to ignore the IP addresses and only specify the log name.

The only problem I now have is that in the "Visitors domains/countries" section it seems to assume that the log name specifies the domain as well, so for example a user who is logged as mydomain\\john.doe (which is the format for any user accessing our site) AWStats thinks that "john" is the domain and "doe" is the country!

This isn't a problem really because only internal domain users access the site but any ideas on how I might be able to tell AWStats not to do the domain/country bit?

Thanks again for your help!

5:55 am
March 24, 2009


Jean-Luc

Admin

posts 1063

Good to hear that it helped.

You can disable the country section in the reports with

ShowDomainsStats=0

in the AWStats config file.

12:24 pm
March 25, 2009


thushanl

Member

posts 3

Thank you!

Again, I should have browsed the config file a bit more carefully! So how is it that you know AWStats inside out? Are you one of the developers? Or do you implement it at client sites?

By the way, you wouldn't happen to be a Microsoft SQL Server Reporting Services (SSRS) expert, would you? :)

12:53 pm
March 25, 2009


Jean-Luc

Admin

posts 1063

I am no AWStats developer, but I have implemented it at thousands (literally) of sites. I am also making all kinds of special developments for clients around AWStats.

Sorry, I never touched SSRS.

Reply to Post

Reply to Topic:
AWStats won't recognize %logname (cs-username) field

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:
1 + 10
   


About the InternetOfficer.com Forum

Forum Timezone: UTC 1

Most Users Ever Online: 201

Currently Online:
11 Guests

Currently Browsing this Topic:
1 Guest

Forum Stats:

Groups: 2
Forums: 9
Topics: 513
Posts: 2447

Membership:

There are 4127 Members
There have been 254 Guests

There is 1 Admin
There is 1 Moderator

Top Posters:

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

Recent New Members: eniko, leptserkhan, JohnnyB, dweb3d, buck, newtoawstat

Administrators: Jean-Luc (1063 Posts)

Moderators: Jean-Luc (1063 Posts)