Unix/Linux Go Back    


Homework & Coursework Questions Students must use and complete the template provided. If you don't, your post may be deleted! Special homework rules apply here.

Date comparison with 'string date having slashes and time zone' in Bash only

Homework & Coursework Questions


Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 10-07-2009
TariqYousaf TariqYousaf is offline
Registered User
 
Join Date: Oct 2009
Last Activity: 9 December 2009, 4:55 PM EST
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Unix or Linux Question Date comparison with 'string date having slashes and time zone' in Bash only

1. The problem statement, all variables and given/known data:
I have standard web server log file. It contains different columns (like IP address, request result code, request type etc) including a date column with the format [31/Mar/2002:19:30:41 +0200].

I have developed a log analysis command line utility that displays different statistics from the log (like the IP with most connection attempts, the most common result codes etc.). In fact to view every stat the user will have to give a specific switch to my utility.

Now comes the problem; with every stat the user can ask to display the results for either 1. previous n hours. or 2. previous n days. I am unable to use the date from the file with format [31/Mar/2002:19:30:41 +0200] and make a comparison with the timestamp of previous n hours or previous n days.

Constraint: I have to attempt this is only in bash.

2. School (University) and Course Number:
Blekinge Institute of Technology
MS Computer Science
Sponsored Links
    #2  
Old Unix and Linux 10-08-2009
vbe's Unix or Linux Image
vbe vbe is offline Forum Staff  
Moderator
 
Join Date: Sep 2005
Last Activity: 19 September 2017, 3:05 PM EDT
Location: Switzerland - GE
Posts: 6,453
Thanks: 283
Thanked 549 Times in 511 Posts
Have you searched the forum?
This could give you some ideas or convince you "Its possible!"
http://www.unix.com/tips-tutorials/3...tion-bash.html
Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
date comparison in bash carp.dk Shell Programming and Scripting 6 07-17-2009 09:44 AM
Date comparison in file to system time zainravi Shell Programming and Scripting 3 03-06-2009 02:48 AM
Simple date and time calulation in BASH ripat Tips and Tutorials 0 10-08-2006 06:15 AM
Help needed - Replacing all date & time occurrences in a file with a string using Sed Hema_M Shell Programming and Scripting 4 11-17-2005 12:42 AM



All times are GMT -4. The time now is 02:21 PM.