Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Log Parsing A log is the automatically produced and time - stamped documentation of events relevant to a particular system. You are given a list
Log Parsing
A log is the automatically produced and timestamped documentation of events relevant to a particular system.
You are given a list of N logs in Apache Extended Log File Format explained below Each log is a string containing exactly characters. You are also given a datetime interval startdate. start timefmishdate, finishtime
Print the number of logs that represent successful requests within the given date time Interval
Example of a log in the specified format
AWAY :::PUTbanneradadgif
Note
The different fields in a log are separated by consecutive underscores Different parts of the same field are separated using one underscore"
Each log is of length characters. The last character of each log is the newline character In The remaining length of each log is filled using underscores to make the length of the log as
Description of Fiels:
User IP Address
RFCused to log the domain for multihomed web servers DateTime the Time is in hr format
Action The particular operation of the hit this is specified in
quotes Return Code The return code indicates whether or not the
action was successful etc. mentioned below
Size of file sent
BrowserPlatform The web browser and platform used by the
user accessing your site
A request is said to be successful if it's Return Code within the range
does not lie
The start date and finishdate are given in the ddmmyyyy format.
A request is said to be successful if it's Return Code does not lie within the range
The start date and finishdate are given in the ddmmyyyy format.
The start time and finishtime are given in the standard hr clock format hh:mm:ss These times are given in GMT
Task
Q
Pint the count of successful logs which lie within the given datetime
Example
HOME :::'PUTbanneradadht HOME :::GETbanneradadg HOME:::GETbanneradadgi HOME:::GETbanneradad HOME::: GETbanneradadht
Given Time: ::::
Output
Approach
The following requests lie within the given time range, and are
successful.
HOME :::GETbanneradadg
HOME :::GETbanneradad
HOME ::: "GETbanneradadht
Hence, the answer is
Function description
Complete the function solve provided in the editor. This function takes the following parameters and returns the required answer:
logslist: A list vector of logs Each member of the list is a string of characters, representing a log
startdate: The starting date a string in ddmmyyyy format.
start time: The starting time a string in standard hr format
hh:mm:ss
finishdate: The finish date a string in ddmmyyyy format.
finishtime: The finish time a string in standard hr format
hh:mm:ss
Input format
Note: This is the input format that you must use to provide custom Input available above the Compile and Test button
The first line contains N the number of logs in the list
The next lines contain strings one in each lineeach string
has characters denoting logs
The third line contains spaceseparated strings, denoting the start date, start time, finishdate and finishtime in the specified formats.
Output format
Print the answer in the given format.
The first and only line contains an integer N the count of
successful logs within the given time frame.
Constraints
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