We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
0 parents commit 39fa344Copy full SHA for 39fa344
loganalyser.py
@@ -0,0 +1,38 @@
1
+import logparser
2
+
3
+logfile = open("access.log","r")
4
5
+day = {}
6
7
+for line in logfile:
8
9
+ logParts = logparser.parser(line)
10
11
+ status = logParts["status"]
12
13
+ time = logParts["time"].split(":")[0]
14
15
+ if time not in day:
16
17
+ day[time] = {}
18
19
+ if status not in day[time]:
20
21
+ day[time][status] = 1
22
+ else:
23
24
+ day[time][status] = day[time][status] + 1
25
26
27
28
29
30
31
32
33
34
+for item in day:
35
36
+ print("The date in which below details are of :-",item)
37
+ print()
38
+ print(day[item], "\n")
0 commit comments