The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Split the access.log based on date ysprathap Shell Programming and Scripting 4 10-10-2008 07:39 AM
Perl Script : Split given month into weeks khushbu_roy Shell Programming and Scripting 5 02-22-2008 11:40 PM
Specify a previous date as start date in shell script ritzwan0 Shell Programming and Scripting 2 09-25-2006 06:58 PM
Shell script to split XML file bayflash27 Shell Programming and Scripting 2 04-05-2006 09:06 AM
Split a field in awk script CamTu Shell Programming and Scripting 4 03-21-2005 04:03 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 01-24-2009
_MCRH_'s Avatar
_MCRH_ _MCRH_ is offline
Registered User
  
 

Join Date: Jan 2009
Location: Cuba
Posts: 3
Question SH script to split squid log by date

Hi,

I really need your help to make a script to split a large squid's log file into a multiple files, each of them containing the log entries for every logged date.

To achieve the result I planned to use the function "date" with the first log field as a parameter using this syntax:

date -d @(ten number squid timestamp field) +%F

to obtain the desired filename for splitted logs.

Example:
# date -d @1232163496 +%F
will return: 2009-01-16

The idea is to analize the first field of each line in the log file and append whole line to the corresponding file.

Any help would be apreciated,

I'm a newbie ¿Someone can help me?

Last edited by _MCRH_; 01-28-2009 at 05:02 PM.. Reason: Before close it
 

Bookmarks

Tags
log, script, split, squid

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:09 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0