-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.md
52 lines (45 loc) · 1.36 KB
/
README.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Operating Systems - Project 1
## Web log analyzer
---
Shell script for analysis of logs from webserver.\
POSIX-ly correct.\
Tested on `Linux` and `FreeBSD`.
**Author:** Peter Koprda <[email protected]>
## Usage
```
$ ./wana [FILTER] [COMMAND] [LOG [LOG2 [...]]
```
### Filters:
```
-a DATETIME show queries after this date;
DATETIME must be in format YYYY-MM-DD HH:MM:SS
-b DATETIME show queries before this date;
DATETIME must be in format YYYY-MM-DD HH:MM:SS
-ip IPADDR show queries from this source address IPADDR;
IPADDR must be IPv4 or IPv6
-uri URI show queries of requests on the webpage URI;
URI is standard regular expression
```
### Commands:
```
list-ip list of source IP adresses
list-hosts list of source domain names
list-uri list of destination sources (URI)
hist-ip create histogram of source IPs
hist-load create histogram of load
```
### Example:
```
$ ./wana.sh -a 2019-02-21 00:00:00 -b 2019-02-22 00:00:00 hist-ip log1 log2
```
```
$ ./wana.sh -uri "/robots\.txt" list-ip log1 log2 log3
```
When no log file is provided, script reads logs from standard input:
```
$ ./wana.sh list-ip
```
Script also accept log files compressed with tool `gzip`:
```
$ ./wana.sh list-ip log.gz
```