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

squid status code

Reply to Post Add a New Topic
UserPost

5:30 pm
December 2, 2010


Wilfried

Member

posts 10

Hello,

 

I would like to know if it's possible to generate reports awstats corresponding of squid logs.

In reality, i would like display in an extrasection the links or the objects that have a squid tcp code, for example TCP_MISS. the status code "TCP_MISS" is an requested object was not in the cache.

 

It is possible to retrieve my objetcs with this status code in an extra section or an other method ?

 

My log format is :

LogFormat = "%host %other %logname %time1 %methodurl %other %code %bytesd %refererquot %uaquot %other %other %virtualname"

and my log is :

123.X.X.X – – [02/Nov/2010:11:53:20 +0000] "GET http://monsiteweb/image123456.png HTTP/1.1" HTTP/1.1" TCP_MISS 200 446181 "http://monsiteweb.fr/" "Mozilla/4.0 (compatible; MSIE 8.0)" "-" 0 monsteweb.fr

5:44 pm
December 2, 2010


Jean-Luc

Admin

posts 1063

Hello Wilfried,

It can be done: replace %other  by %extra1  for the TCP_MISS field and then use extra1  as variable in the extra section.

6:04 pm
December 2, 2010


Wilfried

Member

posts 10

Ok like that ?

 

LogFormat = "%host %other %logname %time1 %methodurl %extra1 %code %bytesd %refererquot %uaquot %other %other %virtualname"

 

But in my extra section, I don't really see how to do ?

ExtraSectionName1="TCP MISS"

ExtraSectionCodeFilter1="TCP_MISS"

ExtraSectionCondition1="extra1"

ExtraSectionFirstColumnTitle1=""

ExtraSectionFirstColumnValues1=""

ExtraSectionFirstColumnFormat1=""

ExtraSectionStatTypes2=HBL

ExtraSectionAddSumRow2=1

MaxNbOfExtra2=20

MinHitExtra2=1

6:16 pm
December 2, 2010


Jean-Luc

Admin

posts 1063

Try this :

ExtraSectionName1="TCP MISS"
ExtraSectionCodeFilter1="200 304"
ExtraSectionCondition1="extra1,^TCP_MISS$"
ExtraSectionFirstColumnTitle1="URL"
ExtraSectionFirstColumnValues1="URL,^(.*)"
ExtraSectionFirstColumnFormat1="<A HREF='%s' TARGET='_blank'>%.80s</A>"
ExtraSectionStatTypes1=PHL
ExtraSectionAddSumRow1=1
MaxNbOfExtra1=20
MinHitExtra1=1

 

I assumed it was your extra section 1.

6:24 pm
December 2, 2010


Wilfried

Member

posts 10

Thank you very much, it's run; but it is possible to display the link in a column beside the status code ?

For the moment, I have the status code in the top of my column but the link http aren't beside the status code, both are separate, it makes no sense, it's stronger.

I'm trying to search…

9:31 pm
December 2, 2010


Jean-Luc

Admin

posts 1063

You cannot add more columns in an extra section.

I am not sure I understood your comment though. Can you reformulate it ?

10:57 am
December 3, 2010


Wilfried

Member

posts 10

I'm sorry for my English …

I wanted to say that the status code and the links are displayed in the same column but there are separate.

In fact, I would like that the status code to be displayed beside the TCP code status or to get one table by TCP status code.

For the moment I get this:

                                                                       TCP MISS    

                                        URL  -   Liste complète                                  Pages Hits Dernière visite

 

TCP_REFRESH_MISS                                                                             12    18

TCP_MISS                                                                                               8     10

TCP_REFRESH_HIT                                                                                 5      6

http://mywebsite….image2.gif…..      2      6

TCP_MEM_HIT                                                                                         2     3

TCP_STALE_HIT                                                                                      1     1

TCP_ASYNC_MISS                                                                                    1    1

http://mywebsite….image1.gif…..      1    1

http://mywebsite….image4.gif…..      1    1

http://mywebsite….image77.gi…..      …

http://mywebsite….image5.gif…..      …

http://mywebsite….image3.gif …

http://mywebsite….image8.gif...

http://mywebsite….image9.gif...

 

And I would like that for the status code TCP_MISS:

                                                                       TCP MISS    

                                        URL  -   Liste complète                                  Pages Hits Dernière visite

 

http://mywebsite….image9.gif…..      12    18

http://mywebsite….image4.gif…..      10    12

http://mywebsite….image2.gif…..      12    18

 

…

11:47 am
December 3, 2010


Jean-Luc

Admin

posts 1063

There must be some configuration errors here. TCP_REFRESH_MISS and TCP_MISS are not URLs and they should not come up in the list. There should also be some value in the "Last visit" column ("Dernière visite").

Did you change things in the extra section ? Or maybe not all lines of the log file are in the same format ?

2:22 pm
December 3, 2010


Wilfried

Member

posts 10

It's running, that's OK ! But the links are not ranked the highest number of hits to the smallest, why ?

And I have one last thing, what means:

%s    and     %.80s      ?

here:

ExtraSectionFirstColumnFormat1="<A HREF='%s' TARGET='_blank'>%.80s</A>"

 

Thank you

2:38 pm
December 3, 2010


Jean-Luc

Admin

posts 1063

Good to hear that the extra section is working for you.

If the number of pages is shown, the extra section is sorted on the number of pages; if several entries have the same number of pages, there is no specific order between these entries. If you replace

ExtraSectionStatTypes1=PHL

by

ExtraSectionStatTypes1=HL

 

I believe that the entries will be sorted on the number of hits.

%s  and %.80s  are formatting characters as explained in Perl sprintf documentation.

When you solved a problem, it is always nice to explain how you did it, so that other users of the forum can benefit from your experience. Thank you.

3:31 pm
December 3, 2010


Wilfried

Member

posts 10

That's running good but I don't have purge my database and my errors were stayed.

4:27 pm
December 3, 2010


Jean-Luc

Admin

posts 1063

Thanks Wilfried.

Bon week-end.Wink

Reply to Post

Reply to Topic:
squid status code

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:
11 + 7
   


About the InternetOfficer.com Forum

Forum Timezone: UTC 1

Most Users Ever Online: 201

Currently Online:
15 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)