LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-07-2011, 12:16 AM   #1
harshaabba
Member
 
Registered: Aug 2009
Posts: 73

Rep: Reputation: -14
Re-Organize Squid access log file....


hi all,

I need to reorganized the following squid access log file in the way I have mentioned below.Date and Time Filed merged using a colon
Eg: 03/Apr/2011:04:02:38 But I need to change this
to: 03/Apr/2011 04:02:38 , Colon should be omitted within all the file.

access.log
172.16.20.174 03/Apr/2011:04:02:38 http://www.manageengine.com/manageengine-ad.html?
172.16.20.174 03/Apr/2011:04:02:39 http://www.manageengine.com/css/advstyle.css
. . .

I need to separate the Date and Time field
New access.log
172.16.20.174 03/Apr/2011 04:02:38 http://www.manageengine.com/manageengine-ad.html?
172.16.20.174 03/Apr/2011 04:02:39 http://www.manageengine.com/css/advstyle.css
. . . .
Please help me to achieve this.

Thanks
 
Old 10-07-2011, 04:41 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

You need to change %tl to be %{%x}tl %{%X}tl in the logformat directive.
Search squid.conf for the access_log directive and see what logformat it uses. E.g. for common you'll see something like that:
Code:
access_log /var/log/squid/access.log common
Then go to the line that defines the logformat used (common in this case, but could be squid, squidmime or combined) and change the %tl as above, e.g.
Code:
logformat common %>a %ui %un [%{%x}tl %{%X}tl] "%rm %ru HTTP/%rv" %>Hs %<st %Ss:%Sh
Note: the above logformat is from squid 3.1.x, so your may vary a little

Regards
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Squid access log file agar_000 Linux - Newbie 1 09-01-2011 05:10 AM
Deleted access.log file from squid evocage Red Hat 3 08-24-2011 03:18 AM
Analyze squid access log file harshaabba Linux - Software 1 06-19-2011 07:40 AM
Organize Log File 0.o Programming 3 05-21-2011 05:59 PM
Squid logging access.log file revinking Linux - Newbie 1 07-28-2008 05:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration