LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Maintain Uploading record in squid (https://www.linuxquestions.org/questions/linux-newbie-8/maintain-uploading-record-in-squid-878725/)

aquamarine 05-04-2011 03:33 AM

Maintain Uploading record in squid
 
Hi

I have Squid Cache: Version 2.6.STABLE21, installed on RHEL5. as well as configured SARG. It provides downloading detail of squid users. but does not provide uploading detail.

I want to maintain uploading record of my users.(e.g which user upload which file/data)

Plz help me in this regard.

jadrevenge 05-04-2011 06:55 AM

you can tell _if_ a user has uploaded, and how much (i.e. how big the file is) but not _what_ the file is ... it's all "PUT" data.

aquamarine 05-06-2011 12:21 AM

Quote:

Originally Posted by jadrevenge (Post 4346125)
you can tell _if_ a user has uploaded, and how much (i.e. how big the file is) but not _what_ the file is ... it's all "PUT" data.

but how to? waiting..........

jadrevenge 05-09-2011 09:24 AM

answer: no you can't ...

"you can tell _if_ a user has uploaded, and how much"

...

"but not _what_ the file is"

aquamarine 05-10-2011 03:11 AM

Quote:

Originally Posted by jadrevenge (Post 4350972)
answer: no you can't ...

"you can tell _if_ a user has uploaded, and how much"

...

"but not _what_ the file is"

Ok, But how to check user has uploaded some thing and how much its size etc...?
waiting......... plz

jadrevenge 05-11-2011 04:35 AM

Quote:

Originally Posted by aquamarine (Post 4351808)
Ok, But how to check user has uploaded some thing and how much its size etc...?
waiting......... plz

quickest way is to look at your access.log file ...

if you don't have user authentication turned on this will probably work for you:

awk '$6 == "PUT" {printf("%s\t%s\n", $5, $0)}' access.log | more

http://wiki.squid-cache.org/SquidFaq...equest_methods

PUT is for when you "upload data" ... the first parameter in access.log is the time, the second is the size of the upload.

not all "PUT"'s are files being uploaded ... but you should be able to tell by the size if the file is big or not, and the URL should hopefully give you a hint as to whether or not a file has been uploaded ...

"http://www.booking.com/load_times" is probably not a file upload ...

"http://s3.amazonaws.com/online-documents/online_documents/2420/My-PDF.pdf" probably is.

aquamarine 05-13-2011 01:03 AM

Quote:

Originally Posted by jadrevenge (Post 4352960)
quickest way is to look at your access.log file ...

if you don't have user authentication turned on this will probably work for you:

awk '$6 == "PUT" {printf("%s\t%s\n", $5, $0)}' access.log | more

http://wiki.squid-cache.org/SquidFaq...equest_methods

PUT is for when you "upload data" ... the first parameter in access.log is the time, the second is the size of the upload.

not all "PUT"'s are files being uploaded ... but you should be able to tell by the size if the file is big or not, and the URL should hopefully give you a hint as to whether or not a file has been uploaded ...

"http://www.booking.com/load_times" is probably not a file upload ...

"http://s3.amazonaws.com/online-documents/online_documents/2420/My-PDF.pdf" probably is.

Thanks for your reply, This command is not working....because
I have turned on user authentication, so what to do? to check upload.
waiting for your response please.....

jadrevenge 05-14-2011 12:08 PM

if you have user authentication turned on the "PUT" will be in some other field than $6 (the sixth field) ...

you could grep for PUT in the file and change the awk script to work with a different field number ...

aquamarine 05-16-2011 12:36 AM

Quote:

Originally Posted by jadrevenge (Post 4356325)
if you have user authentication turned on the "PUT" will be in some other field than $6 (the sixth field) ...

you could grep for PUT in the file and change the awk script to work with a different field number ...

Thanks for your reply, I've tried to $22, but couldn't find result. the command show no results.

Command was (awk '$7 == "PUT" {printf("%s\t%s\n", $5, $0)}' access.log | more)
(awk '$8 == "PUT" {printf("%s\t%s\n", $5, $0)}' access.log | more)
etc......

Still waiting...... your response.

jadrevenge 05-18-2011 06:57 AM

Quote:

Originally Posted by aquamarine (Post 4357499)
Thanks for your reply, I've tried to $22, but couldn't find result. the command show no results.

Command was (awk '$7 == "PUT" {printf("%s\t%s\n", $5, $0)}' access.log | more)
(awk '$8 == "PUT" {printf("%s\t%s\n", $5, $0)}' access.log | more)
etc......

Still waiting...... your response.

Have you (or a predecessor) modified the log file output?

http://wiki.squid-cache.org/Features/LogFormat

It is possible that you don't have "method" in your log file output, if this is so then you probably need to put in in.

if you are having trouble, it might be worth looking at the Log analysers at http://www.squid-cache.org/Scripts/ there are just s _few_ to choose from.

We've used at least the first 2 in the list in the past.

Jon


All times are GMT -5. The time now is 05:16 PM.