Answered step by step
Verified Expert Solution
Question
1 Approved Answer
hint u may need to use commands cut, grep, sort, and/or uniq in ur script Checkpoint 2.3: Shell Seript to analvere veb log (Please submit
hint
Checkpoint 2.3: Shell Seript to analvere veb log (Please submit and evaluate your answer in VPL) Suppose the web server of your company website that produces a log file which captures every page access in the following format: in. addres date..YYXYmm/d time.Liti:MaMSS pase. accessed Hene is a sample content of such file: You are asked to write a shell seript, getProductAceess.sh, which captures the product pages under /produets/ accessed by each IP address. The script takes one command line argument, which is the filename of a log file. ft will read the content of the log file specified, find and print the product pages each IP address accessed. The output should be sorted by IP address and then by the product page. - Sorting is done alphabetically, ascendingly for both IP address and product page, i.e, 192.168.0.1I will be ordered before 192.168.0.2. - Only pages sarting with/preducts/ should be printed. - You can assume that the input file will strictly follow the above format. I.c: Each page access is recorded on a separated line. Fach value (ip address, date, rime and pasc accesed) are separated by tabs. The values will not consist of spaces or tabs. - The script does not need to handle cases where the input file is empty, or if there is not enough argument specified. Assume we have access-2014-09-04.log in the current directory, with the following content: Checkpoint Module 2 The seript will print: Note that IP 192.168.130.175 accessed/products/296.html multiple times, but there should only be one corresponding line in the output u may need to use commands "cut", "grep", "sort", and/or "uniq" in ur script
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started