473,544 Members | 2,352 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

a python program which will summarise an apache web server log file

2 New Member
Please can anyone help me with this ----- I am very new in learning python.

This program should report the total number of successful web server accesses and, if the -p "projectnam e" option is given then the program should report the number of accesses (in total and as a percentage) under this project. the program should also use a -f option to indicate which web server log file is to be summarised. For example a system administrator might use the program in the following way:

$ ./webscan.py -f access.data

indicates that the total number of accesses as logged in access.data will be displayed.

$ ./webscan.py -f access.data -p /pipermail

indicates that the total number of web server accesses are displayed together with the number of web server accesses in the pipermail folder.


examples
$ ./webscan.py -f access.data
Total number of accesses: 6
$ ./webscan.py -f access.data -p /pipermail
Total number of accesses: 6
Number of accesses in pipermail: 3 (50%)

Thanks
Jan 2 '08 #1
1 1102
oler1s
671 Recognized Expert Contributor
This is a homework or job assignment. We do not do other people's assignments. Either come back with a real question or don't spam with homework requests.
Jan 2 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
14151
by: Mike | last post by:
I am sure that I am making a simple boneheaded mistake and I would appreciate your help in spotting in. I have just installed apache_2.0.53-win32-x86-no_ssl.exe php-5.0.3-Win32.zip Smarty-2.6.7.tar.gz on a system running WindowsXP SP2. Apache and PHP tested out fine. After adding Smarty, I ran the following http://localhost/testphp.php
6
3829
by: Will Stuyvesant | last post by:
I am uploading a .zip file to a Python CGI program, using a form on a HTML page with <input name="yourfile" type="file">... In the Python CGI program I do: import cgi fStorage = cgi.FieldStorage() zipdata = fStorage.value
1
2054
by: Ron Davis | last post by:
I have recently discovered Python and like it quite a bit. I would like to use it on a new project I am starting. The project will gather data from several web services and present the collected data to browser users through a web server. So basically I need a full-time web server and a separate way to poll web services for their data....
2
1639
by: arvind | last post by:
When I run the script on server,only HTML part gets executed. But the python code appears as it is on the screen in the text format. How to run the CGI script on web server using Python2.4.3?
14
3007
by: nicolasg | last post by:
Hi folks, I have accomplished to make a python program that make some image manipulation to bmp files. I now want to provide this program as a web service. A user can visit a site and through a web interface he should upload the file to the web server , the server then will do the image process with the python program I have wrote and when it...
3
4821
by: Mike Orr | last post by:
I'm trying to install a program that uses Durus on a server. It appears that if a Python program uses eggs, it creates a ~/.python-eggs/ directory, so the home directory must be writeable. This conflicts with server environments where you want to run a daemon with minimum privileges. Second, it appears to use the real user ID rather than...
113
5188
by: John Nagle | last post by:
The major complaint I have about Python is that the packages which connect it to other software components all seem to have serious problems. As long as you don't need to talk to anything outside the Python world, you're fine. But once you do, things go downhill. MySQLdb has version and platform compatibility problems. So does M2Crypto. ...
3
4927
by: joe jacob | last post by:
I configured apache to execute python scripts using mod_python handler. I followed below mentioned steps to configure apache. 1. In http.conf I added <Directory "D:/softwares/Apache2.2/htdocs"> AddHandler mod_python .py PythonHandler mptest PythonDebug On </Directory>
1
1992
by: docdoc | last post by:
Please can anyone help me with this ----- I am very new in learning python. This program should report the total number of successful web server accesses and, if the -p "projectname" option is given then the program should report the number of accesses (in total and as a percentage) under this project. the program should also use a -f option...
0
7438
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7374
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7632
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7720
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5931
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5309
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3422
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1850
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
677
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.