darold / squidanalyzer

Squid Analyzer parses Squid proxy access log and reports general statistics about hits, bytes, users, networks, top URLs, and top second level domains. Statistic reports are oriented toward user and bandwidth control.
http://squidanalyzer.darold.net/
125 stars 36 forks source link

Report by user groups (areas) #214

Closed neok7 closed 3 years ago

neok7 commented 4 years ago

Hello! I have used SquidAnalyzer in the past together with SQUID with Kerberos and LDAP authentication and I have had excellent results. Now, in a new implementation of SQUID, also with authentication, I would like to use it again to generate monthly reports about the use of the Internet not only by user but also by areas. The idea is to obtain a monthly report of the Internet consumption of different areas, which are actually a group of users.

Would you please tell me if it is possible to do it with SquidAnalyzer?

Thank you very much in advance. Best regards,

Gabriel

darold commented 4 years ago

Hi,

It depends if the information of the group/area is available in the authent field of the squid log. If you only have the login name and you know in which area they are you have to build your area-user association list in file /etc/squidanalyzer/user-aliases, for example:

AreaOne    user1,user4,user5
AreaTwo    user2,user3,user6

If you have the group/area in the authent field you can use a regexp. For example let's say you have something like usermae@groupname you can build your association using Perl Regexp:

AreaOne    .*\@group[1-3]
AreaTwo    .*\@(group4|group7)

If you don't have this capability with the authent field, you can use the ip adress if you have subnetworks per area.