Ruby Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesRuby Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 7th, 2013, 10:20 AM
djrj192 djrj192 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2013
Posts: 3 djrj192 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 41 m 43 sec
Reputation Power: 0
Need Help with a program Please

Can someone please help me with a solution to this program. It would be greatly appriciated.

Simple web server log analysis program that will read the provided apache.log file and
use a case statement to print the HTTP method used by each web transaction in the log.
Each line of the log file is a single file transaction and has a clearly displayed HTTP verb.
Since this is a good web server, it only accepts HEAD, GET, POST, and OPTIONS. There are other methods like TRACE, if these are encountered 'invalid' should be displayed.

For the provided log file, your output
should look something like:
Request 1 used GET.
Request 2 used GET.
Request 3 used GET.
Request 4 used GET.
Request 5 used POST.
Request 6 used an invalid verb/method.
Request 7 used HEAD.

There is no need to write code to read the file. Use the gets method to read from standard input
(STDIN). When running the program, use I/O redirection to redirect the file to standard input like
this:

$ ruby_name_1.rb < apache.log

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesRuby Programming > Need Help with a program Please

Developer Shed Advertisers and Affiliates



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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap