Rack of Ethernet switches.

Visualizing Log Patterns with Color

Nginx and Apache Logs in Color

Web server logs reveal patterns of activity by web crawlers. Some are indexing crawlers operated by search engines, some are mysterious. Another pattern is systematic blind searches for vulnerable server-side executables or other configuration problems. The pattern you want to see is the interested user who follows some path through the hyperlinks on your site, taking time to read the pages.

Maybe we could use color to help spot these patterns?

Maybe...

First, let's look at the result, then the explanation comes later. Here are the most recent client requests, starting most recent first. Your request for this page won't appear there as it isn't complete by the time this page was automatically generated with PHP. But if you reload the page you should see your initial request near the top.

3.145.105.108 US, United States 29/Apr/2024:00:45:30 /robots.txt
208.87.128.240 US, United States 29/Apr/2024:00:45:20 /travel/japan/tokyo-shinjuku/?s=mb
134.209.193.209 US, United States 29/Apr/2024:00:45:13 /travel/japan/tokyo-shinjuku/?s=mb
216.24.162.126 US, United States 29/Apr/2024:00:45:12 /travel/japan/tokyo-shinjuku/?s=mb
95.216.93.152 FI, Finland 29/Apr/2024:00:45:10 /travel/japan/tokyo-shinjuku/?s=mb
147.182.159.4 US, United States 29/Apr/2024:00:45:10 /travel/japan/tokyo-shinjuku/?s=mb
83.223.95.237 DE, Germany 29/Apr/2024:00:45:10 /travel/japan/tokyo-shinjuku/?s=mb
5.75.170.42 IR, Iran, Islamic Republic of 29/Apr/2024:00:45:09 /travel/japan/tokyo-shinjuku/?s=mb
88.198.1.113 DE, Germany 29/Apr/2024:00:45:09 /travel/japan/tokyo-shinjuku/?s=mb
122.192.90.200 CN, China 29/Apr/2024:00:45:09 /open-source/nginx-openssl-quantum-safe/
154.38.171.172 US, United States 29/Apr/2024:00:45:08 /travel/japan/tokyo-shinjuku/?s=mb
167.179.83.164 NZ, New Zealand 29/Apr/2024:00:45:07 /travel/japan/tokyo-shinjuku/?s=mb
167.71.128.79 US, United States 29/Apr/2024:00:45:07 /travel/japan/tokyo-shinjuku/?s=mb
57.128.118.171 BE, Belgium 29/Apr/2024:00:45:07 /travel/japan/tokyo-shinjuku/?s=mb
104.9.120.22 US, United States 29/Apr/2024:00:45:06 /travel/japan/tokyo-shinjuku/?s=mb
65.21.62.142 US, United States 29/Apr/2024:00:45:06 /travel/japan/tokyo-shinjuku/?s=mb
172.232.10.45 US, United States 29/Apr/2024:00:45:05 /travel/japan/tokyo-shinjuku/?s=mb
116.203.228.152 IN, India 29/Apr/2024:00:45:05 /travel/japan/tokyo-shinjuku/?s=mb
107.189.4.158 LU, Luxembourg 29/Apr/2024:00:45:05 /travel/japan/tokyo-shinjuku/?s=mb
141.95.154.4 GB, United Kingdom 29/Apr/2024:00:45:05 /travel/japan/tokyo-shinjuku/?s=mb
78.46.181.125 DE, Germany 29/Apr/2024:00:45:05 /travel/japan/tokyo-shinjuku/?s=mb
69.207.181.246 US, United States 29/Apr/2024:00:45:04 /travel/japan/tokyo-shinjuku/?s=mb
159.69.59.159 DE, Germany 29/Apr/2024:00:45:04 /travel/japan/tokyo-shinjuku/?s=mb
74.194.226.131 US, United States 29/Apr/2024:00:45:04 /travel/uk/swingate-chain-home/?s=mb
23.81.164.200 US, United States 29/Apr/2024:00:45:04 /travel/japan/tokyo-shinjuku/?s=mb
93.93.128.11 GB, United Kingdom 29/Apr/2024:00:45:04 /travel/japan/tokyo-shinjuku/?s=mb
138.68.6.8 US, United States 29/Apr/2024:00:45:04 /travel/japan/tokyo-shinjuku/?s=mb
194.195.127.156 DE, Germany 29/Apr/2024:00:45:03 /travel/japan/tokyo-shinjuku/?s=mb
93.190.139.159 NL, Netherlands 29/Apr/2024:00:45:03 /travel/japan/tokyo-shinjuku/?s=mb
23.254.165.3 US, United States 29/Apr/2024:00:45:03 /travel/japan/tokyo-shinjuku/?s=mb
45.79.44.115 US, United States 29/Apr/2024:00:45:02 /travel/japan/tokyo-shinjuku/?s=mb
23.95.166.46 US, United States 29/Apr/2024:00:45:02 /travel/japan/tokyo-shinjuku/?s=mb
68.252.16.184 US, United States 29/Apr/2024:00:45:02 /travel/japan/tokyo-shinjuku/?s=mb
54.91.240.230 US, United States 29/Apr/2024:00:45:02 /travel/japan/tokyo-shinjuku/?s=mb
106.178.112.231 JP, Japan 29/Apr/2024:00:45:02 /travel/japan/tokyo-shinjuku/?s=mb
51.222.253.13 FR, France 29/Apr/2024:00:45:02 /travel/japan/kamakura/engaku-ji.html
57.128.95.182 BE, Belgium 29/Apr/2024:00:45:02 /travel/japan/tokyo-shinjuku/?s=mb
5.78.113.49 IR, Iran, Islamic Republic of 29/Apr/2024:00:45:01 /travel/japan/tokyo-shinjuku/?s=mb
84.50.196.6 EE, Estonia 29/Apr/2024:00:45:01 /travel/japan/tokyo-shinjuku/?s=mb
95.217.190.18 FI, Finland 29/Apr/2024:00:45:01 /travel/japan/tokyo-shinjuku/?s=mb
65.108.255.89 US, United States 29/Apr/2024:00:45:00 /travel/uk/hadrians-wall/?s=mb
95.111.251.213 UA, Ukraine 29/Apr/2024:00:45:00 /travel/japan/tokyo-shinjuku/?s=mb
84.246.124.37 DE, Germany 29/Apr/2024:00:45:00 /travel/japan/tokyo-shinjuku/?s=mb
143.110.144.224 US, United States 29/Apr/2024:00:45:00 /travel/japan/tokyo-shinjuku/?s=mb
35.86.219.10 US, United States 29/Apr/2024:00:45:00 /travel/japan/tokyo-shinjuku/?s=mb
146.255.56.82 AT, Austria 29/Apr/2024:00:45:00 /travel/japan/tokyo-shinjuku/?s=mb
173.255.213.247 US, United States 29/Apr/2024:00:45:00 /travel/japan/tokyo-shinjuku/?s=mb
89.58.44.73 DE, Germany 29/Apr/2024:00:45:00 /travel/japan/tokyo-shinjuku/?s=mb
67.225.40.141 CA, Canada 29/Apr/2024:00:45:00 /travel/japan/tokyo-shinjuku/?s=mb
206.116.229.157 CA, Canada 29/Apr/2024:00:45:00 /travel/japan/tokyo-shinjuku/?s=mb
167.235.203.122 US, United States 29/Apr/2024:00:45:00 /travel/japan/tokyo-shinjuku/?s=mb
128.0.64.88 NL, Netherlands 29/Apr/2024:00:44:59 /travel/japan/tokyo-shinjuku/?s=mb
68.66.251.30 US, United States 29/Apr/2024:00:44:59 /travel/japan/tokyo-shinjuku/?s=mb
5.75.240.129 IR, Iran, Islamic Republic of 29/Apr/2024:00:44:59 /travel/japan/tokyo-shinjuku/?s=mb
23.81.164.200 US, United States 29/Apr/2024:00:44:59 /travel/japan/tokyo-shinjuku/?s=mb
52.184.138.36 US, United States 29/Apr/2024:00:44:59 /travel/japan/tokyo-shinjuku/?s=mb
164.68.125.35 US, United States 29/Apr/2024:00:44:59 /travel/japan/tokyo-shinjuku/?s=mb
46.4.156.213 DE, Germany 29/Apr/2024:00:44:59 /travel/japan/tokyo-shinjuku/?s=mb
151.80.33.67 FR, France 29/Apr/2024:00:44:58 /travel/japan/tokyo-shinjuku/?s=mb
45.79.192.11 US, United States 29/Apr/2024:00:44:58 /travel/japan/tokyo-shinjuku/?s=mb
193.30.122.175 DE, Germany 29/Apr/2024:00:44:58 /travel/japan/tokyo-shinjuku/?s=mb
159.89.119.136 CA, Canada 29/Apr/2024:00:44:58 /travel/japan/tokyo-shinjuku/?s=mb
85.215.49.242 DE, Germany 29/Apr/2024:00:44:57 /travel/japan/tokyo-shinjuku/?s=mb
195.201.111.25 DE, Germany 29/Apr/2024:00:44:57 /travel/japan/tokyo-shinjuku/?s=mb
146.255.56.82 AT, Austria 29/Apr/2024:00:44:57 /travel/japan/tokyo-shinjuku/?s=mb
57.128.95.175 BE, Belgium 29/Apr/2024:00:44:57 /travel/japan/tokyo-shinjuku/?s=mb
142.132.159.116 CA, Canada 29/Apr/2024:00:44:57 /travel/japan/tokyo-shinjuku/?s=mb
5.9.77.71 DE, Germany 29/Apr/2024:00:44:57 /travel/japan/tokyo-shinjuku/?s=mb
20.150.150.150 US, United States 29/Apr/2024:00:44:56 /travel/japan/tokyo-shinjuku/?s=mb
18.130.137.194 GB, United Kingdom 29/Apr/2024:00:44:56 /travel/japan/tokyo-shinjuku/?s=mb
78.46.181.125 DE, Germany 29/Apr/2024:00:44:56 /travel/japan/tokyo-shinjuku/?s=mb
90.250.9.255 GB, United Kingdom 29/Apr/2024:00:44:56 /travel/japan/tokyo-shinjuku/?s=mb
65.109.234.6 US, United States 29/Apr/2024:00:44:56 /travel/japan/tokyo-shinjuku/?s=mb
62.122.39.42 Unknown 29/Apr/2024:00:44:56 /travel/japan/tokyo-shinjuku/?s=mb
138.201.244.150 DE, Germany 29/Apr/2024:00:44:56 /travel/japan/tokyo-shinjuku/?s=mb
129.151.64.106 US, United States 29/Apr/2024:00:44:55 /travel/japan/tokyo-shinjuku/?s=mb
176.9.111.120 DE, Germany 29/Apr/2024:00:44:55 /travel/japan/tokyo-shinjuku/?s=mb
148.251.28.156 DE, Germany 29/Apr/2024:00:44:55 /travel/japan/tokyo-shinjuku/?s=mb
65.21.135.163 US, United States 29/Apr/2024:00:44:55 /travel/japan/tokyo-shinjuku/?s=mb
94.130.53.86 DE, Germany 29/Apr/2024:00:44:55 /travel/japan/tokyo-shinjuku/?s=mb
198.98.56.222 US, United States 29/Apr/2024:00:44:55 /travel/japan/tokyo-shinjuku/?s=mb
132.145.78.154 US, United States 29/Apr/2024:00:44:55 /travel/japan/tokyo-shinjuku/?s=mb
148.251.28.156 DE, Germany 29/Apr/2024:00:44:55 /travel/japan/tokyo-shinjuku/?s=mb
192.210.203.52 US, United States 29/Apr/2024:00:44:55 /travel/japan/tokyo-shinjuku/?s=mb
71.135.1.217 US, United States 29/Apr/2024:00:44:55 /travel/japan/tokyo-shinjuku/?s=mb
45.77.5.31 US, United States 29/Apr/2024:00:44:54 /travel/japan/tokyo-shinjuku/?s=mb
193.7.176.160 DE, Germany 29/Apr/2024:00:44:54 /travel/japan/tokyo-shinjuku/?s=mb
5.78.68.112 IR, Iran, Islamic Republic of 29/Apr/2024:00:44:54 /travel/japan/tokyo-shinjuku/?s=mb
143.244.177.66 US, United States 29/Apr/2024:00:44:54 /travel/japan/tokyo-shinjuku/?s=mb
64.227.98.185 US, United States 29/Apr/2024:00:44:54 /travel/japan/tokyo-shinjuku/?s=mb
57.128.95.181 BE, Belgium 29/Apr/2024:00:44:53 /travel/japan/tokyo-shinjuku/?s=mb
95.216.33.203 FI, Finland 29/Apr/2024:00:44:53 /travel/japan/tokyo-shinjuku/?s=mb
154.12.226.9 US, United States 29/Apr/2024:00:44:53 /travel/japan/tokyo-shinjuku/?s=mb
73.93.173.52 US, United States 29/Apr/2024:00:44:53 /travel/japan/tokyo-shinjuku/?s=mb
194.71.11.42 SE, Sweden 29/Apr/2024:00:44:52 /travel/japan/tokyo-shinjuku/?s=mb
141.95.205.41 GB, United Kingdom 29/Apr/2024:00:44:52 /travel/japan/tokyo-shinjuku/?s=mb
146.190.36.229 US, United States 29/Apr/2024:00:44:52 /travel/japan/tokyo-shinjuku/?s=mb
128.199.14.189 SG, Singapore 29/Apr/2024:00:44:51 /travel/japan/tokyo-shinjuku/?s=mb
5.75.243.239 IR, Iran, Islamic Republic of 29/Apr/2024:00:44:51 /travel/japan/tokyo-shinjuku/?s=mb
51.222.206.38 FR, France 29/Apr/2024:00:44:51 /travel/japan/tokyo-shinjuku/?s=mb
157.90.225.212 US, United States 29/Apr/2024:00:44:51 /travel/japan/tokyo-shinjuku/?s=mb
185.199.222.29 GB, United Kingdom 29/Apr/2024:00:44:51 /travel/japan/tokyo-shinjuku/?s=mb
198.23.134.100 US, United States 29/Apr/2024:00:44:51 /travel/japan/tokyo-shinjuku/?s=mb
23.166.120.27 Unknown 29/Apr/2024:00:44:51 /travel/japan/tokyo-shinjuku/?s=mb
44.238.50.200 US, United States 29/Apr/2024:00:44:50 /travel/japan/tokyo-shinjuku/?s=mb
54.164.161.50 US, United States 29/Apr/2024:00:44:50 /travel/japan/tokyo-shinjuku/?s=mb
86.155.200.19 GB, United Kingdom 29/Apr/2024:00:44:50 /travel/japan/tokyo-shinjuku/?s=mb
116.203.72.98 IN, India 29/Apr/2024:00:44:50 /travel/japan/tokyo-shinjuku/?s=mb
193.135.10.216 CH, Switzerland 29/Apr/2024:00:44:50 /travel/japan/tokyo-shinjuku/?s=mb
5.75.251.148 IR, Iran, Islamic Republic of 29/Apr/2024:00:44:50 /travel/japan/tokyo-shinjuku/?s=mb
141.95.205.46 GB, United Kingdom 29/Apr/2024:00:44:49 /travel/japan/tokyo-shinjuku/?s=mb
71.191.71.248 US, United States 29/Apr/2024:00:44:49 /travel/japan/tokyo-shinjuku/?s=mb
132.145.173.44 US, United States 29/Apr/2024:00:44:49 /travel/japan/tokyo-shinjuku/?s=mb
167.99.54.94 US, United States 29/Apr/2024:00:44:49 /travel/japan/tokyo-shinjuku/?s=mb
18.221.193.45 US, United States 29/Apr/2024:00:44:49 /travel/japan/tokyo-shinjuku/?s=mb
147.182.238.84 US, United States 29/Apr/2024:00:44:49 /travel/japan/tokyo-shinjuku/?s=mb
164.92.127.252 US, United States 29/Apr/2024:00:44:49 /travel/japan/tokyo-shinjuku/?s=mb
162.198.11.146 US, United States 29/Apr/2024:00:44:49 /travel/japan/tokyo-shinjuku/?s=mb
217.122.55.84 NL, Netherlands 29/Apr/2024:00:44:48 /travel/japan/tokyo-shinjuku/?s=mb
90.170.167.136 ES, Spain 29/Apr/2024:00:44:47 /travel/japan/tokyo-shinjuku/?s=mb
143.110.212.11 US, United States 29/Apr/2024:00:44:47 /travel/japan/tokyo-shinjuku/?s=mb
65.109.49.87 US, United States 29/Apr/2024:00:44:47 /travel/japan/tokyo-shinjuku/?s=mb
57.128.95.181 BE, Belgium 29/Apr/2024:00:44:47 /travel/japan/tokyo-shinjuku/?s=mb
141.95.205.35 GB, United Kingdom 29/Apr/2024:00:44:47 /travel/japan/tokyo-shinjuku/?s=mb
141.95.205.35 GB, United Kingdom 29/Apr/2024:00:44:47 /travel/japan/tokyo-shinjuku/?s=mb
148.251.126.87 DE, Germany 29/Apr/2024:00:44:47 /travel/japan/tokyo-shinjuku/?s=mb
51.210.99.95 FR, France 29/Apr/2024:00:44:46 /travel/japan/tokyo-shinjuku/?s=mb
37.187.74.178 FR, France 29/Apr/2024:00:44:46 /travel/japan/tokyo-shinjuku/?s=mb
150.136.181.20 US, United States 29/Apr/2024:00:44:46 /travel/japan/tokyo-shinjuku/?s=mb
199.167.29.8 US, United States 29/Apr/2024:00:44:46 /travel/japan/tokyo-shinjuku/?s=mb
35.178.43.102 GB, United Kingdom 29/Apr/2024:00:44:46 /travel/japan/tokyo-shinjuku/?s=mb
149.28.39.36 US, United States 29/Apr/2024:00:44:46 /travel/japan/tokyo-shinjuku/?s=mb
5.161.74.177 IR, Iran, Islamic Republic of 29/Apr/2024:00:44:46 /travel/japan/tokyo-shinjuku/?s=mb
185.170.114.165 DE, Germany 29/Apr/2024:00:44:46 /travel/japan/tokyo-shinjuku/?s=mb
158.69.240.84 CA, Canada 29/Apr/2024:00:44:46 /travel/japan/tokyo-shinjuku/?s=mb
74.99.75.19 US, United States 29/Apr/2024:00:44:46 /travel/japan/tokyo-shinjuku/?s=mb
91.107.203.134 IR, Iran, Islamic Republic of 29/Apr/2024:00:44:46 /travel/japan/tokyo-shinjuku/?s=mb
5.75.146.253 IR, Iran, Islamic Republic of 29/Apr/2024:00:44:45 /travel/japan/tokyo-shinjuku/?s=mb
65.109.144.230 US, United States 29/Apr/2024:00:44:45 /travel/japan/tokyo-shinjuku/?s=mb
138.201.222.244 DE, Germany 29/Apr/2024:00:44:45 /travel/japan/tokyo-shinjuku/?s=mb
15.204.47.199 US, United States 29/Apr/2024:00:44:45 /travel/japan/tokyo-shinjuku/?s=mb
141.95.205.46 GB, United Kingdom 29/Apr/2024:00:44:45 /travel/japan/tokyo-shinjuku/?s=mb
134.122.76.6 US, United States 29/Apr/2024:00:44:44 /travel/japan/tokyo-shinjuku/?s=mb
164.92.69.172 US, United States 29/Apr/2024:00:44:44 /travel/japan/tokyo-shinjuku/?s=mb
50.230.231.66 US, United States 29/Apr/2024:00:44:44 /travel/japan/tokyo-shinjuku/?s=mb
137.184.182.149 US, United States 29/Apr/2024:00:44:44 /travel/japan/tokyo-shinjuku/?s=mb
203.129.31.244 AU, Australia 29/Apr/2024:00:44:44 /travel/japan/tokyo-shinjuku/?s=mb
162.55.217.224 US, United States 29/Apr/2024:00:44:43 /travel/japan/tokyo-shinjuku/?s=mb
167.235.146.56 US, United States 29/Apr/2024:00:44:43 /travel/japan/tokyo-shinjuku/?s=mb
208.85.21.104 US, United States 29/Apr/2024:00:44:43 /travel/japan/tokyo-shinjuku/?s=mb
161.35.87.199 US, United States 29/Apr/2024:00:44:43 /travel/japan/tokyo-shinjuku/?s=mb
144.217.65.224 CA, Canada 29/Apr/2024:00:44:43 /travel/japan/tokyo-shinjuku/?s=mb
57.128.95.173 BE, Belgium 29/Apr/2024:00:44:43 /travel/japan/tokyo-shinjuku/?s=mb
161.35.35.39 US, United States 29/Apr/2024:00:44:42 /travel/japan/tokyo-shinjuku/?s=mb
57.128.95.173 BE, Belgium 29/Apr/2024:00:44:42 /travel/japan/tokyo-shinjuku/?s=mb
109.70.142.60 GB, United Kingdom 29/Apr/2024:00:44:42 /travel/japan/tokyo-shinjuku/?s=mb
204.238.213.138 US, United States 29/Apr/2024:00:44:41 /travel/japan/tokyo-shinjuku/?s=mb
130.61.32.16 DE, Germany 29/Apr/2024:00:44:41 /travel/japan/tokyo-shinjuku/?s=mb
57.128.118.108 BE, Belgium 29/Apr/2024:00:44:41 /travel/japan/tokyo-shinjuku/?s=mb
149.202.69.200 FR, France 29/Apr/2024:00:44:41 /travel/japan/tokyo-shinjuku/?s=mb
35.165.97.169 US, United States 29/Apr/2024:00:44:41 /travel/japan/tokyo-shinjuku/?s=mb
185.121.168.233 NZ, New Zealand 29/Apr/2024:00:44:41 /travel/japan/tokyo-shinjuku/?s=mb
159.69.63.241 DE, Germany 29/Apr/2024:00:44:41 /travel/japan/tokyo-shinjuku/?s=mb
185.233.107.67 DE, Germany 29/Apr/2024:00:44:40 /travel/japan/tokyo-shinjuku/?s=mb
31.172.31.214 DE, Germany 29/Apr/2024:00:44:40 /travel/japan/tokyo-shinjuku/?s=mb
102.132.192.141 Unknown 29/Apr/2024:00:44:40 /travel/japan/tokyo-shinjuku/?s=mb
176.58.112.4 GB, United Kingdom 29/Apr/2024:00:44:40 /travel/japan/tokyo-shinjuku/?s=mb
141.95.205.35 GB, United Kingdom 29/Apr/2024:00:44:40 /travel/japan/tokyo-shinjuku/?s=mb
45.135.201.204 Unknown 29/Apr/2024:00:44:40 /travel/japan/tokyo-shinjuku/?s=mb
78.46.181.125 DE, Germany 29/Apr/2024:00:44:40 /travel/japan/tokyo-shinjuku/?s=mb
15.204.143.142 US, United States 29/Apr/2024:00:44:40 /travel/japan/tokyo-shinjuku/?s=mb
152.53.19.124 US, United States 29/Apr/2024:00:44:40 /travel/japan/tokyo-shinjuku/?s=mb
104.28.249.215 US, United States 29/Apr/2024:00:44:39 /travel/japan/tokyo-shinjuku/?s=mb
134.122.101.11 US, United States 29/Apr/2024:00:44:39 /travel/japan/tokyo-shinjuku/?s=mb
162.19.87.99 US, United States 29/Apr/2024:00:44:39 /travel/japan/tokyo-shinjuku/?s=mb
62.210.209.158 FR, France 29/Apr/2024:00:44:39 /travel/japan/tokyo-shinjuku/?s=mb
46.22.99.207 IS, Iceland 29/Apr/2024:00:44:39 /travel/japan/tokyo-shinjuku/?s=mb
23.88.72.209 US, United States 29/Apr/2024:00:44:39 /travel/japan/tokyo-shinjuku/?s=mb
159.223.195.78 US, United States 29/Apr/2024:00:44:38 /travel/japan/tokyo-shinjuku/?s=mb
51.81.67.122 FR, France 29/Apr/2024:00:44:38 /travel/japan/tokyo-shinjuku/?s=mb
116.202.53.163 IN, India 29/Apr/2024:00:44:38 /travel/japan/tokyo-shinjuku/?s=mb
65.109.98.227 US, United States 29/Apr/2024:00:44:38 /travel/japan/tokyo-shinjuku/?s=mb
89.58.36.157 DE, Germany 29/Apr/2024:00:44:38 /travel/japan/tokyo-shinjuku/?s=mb
20.81.102.204 US, United States 29/Apr/2024:00:44:38 /travel/japan/tokyo-shinjuku/?s=mb
65.21.186.144 US, United States 29/Apr/2024:00:44:38 /travel/japan/tokyo-shinjuku/?s=mb
153.126.168.112 JP, Japan 29/Apr/2024:00:44:38 /travel/japan/tokyo-shinjuku/?s=mb
114.44.239.70 TW, Taiwan 29/Apr/2024:00:44:37 /travel/japan/tokyo-shinjuku/?s=mb
154.53.57.145 US, United States 29/Apr/2024:00:44:37 /travel/japan/tokyo-shinjuku/?s=mb
116.203.225.209 IN, India 29/Apr/2024:00:44:37 /travel/japan/tokyo-shinjuku/?s=mb
162.231.202.249 US, United States 29/Apr/2024:00:44:37 /travel/japan/tokyo-shinjuku/?s=mb
57.128.95.181 BE, Belgium 29/Apr/2024:00:44:36 /travel/japan/tokyo-shinjuku/?s=mb
104.200.25.119 US, United States 29/Apr/2024:00:44:36 /travel/japan/tokyo-shinjuku/?s=mb
92.60.41.50 Unknown 29/Apr/2024:00:44:36 /travel/japan/tokyo-shinjuku/?s=mb
95.216.151.17 FI, Finland 29/Apr/2024:00:44:36 /travel/japan/tokyo-shinjuku/?s=mb

Here's what's going on.

Each line above is a request from a client, extracted from Nginx's /var/www/logs/httpd-access.log file. The client IP address, timestamp, and requested path were selected with awk and the client IP address converted to a country if possible with geoiplookup.

Geolocate IP

You can use a service such as Abstract's IP geolocation to check if the conversion was successful, or if the client IP address is the exit portal of a VPN.

The first 3 octets or first 24 bits of the IP address are used to specify the hue, with chroma at 75% and intensity at 100%. The resulting red, green, and blue values are scaled to the range of 0-255 and printed as two-character hexadecimal in an HTML style string.

Low-numbered /8 networks appear as red, 20.0.0.0/8 through 40.0.0.0/8 are orange shifting to yellow, 50.0.0.0/8 through 110.0.0.0/8 are shades of green, the /16 networks 130.0.0.0/16 through about 180.0.0.0/16 are shades of blue, then it's shades of purple into magenta for the /24 networks 192.0.0.0/24 and up through 223.255.255.0/24.

The HTML file on the server has a line where PHP uses passthru() to call the following shell script:

#!/bin/sh

# Initial pipeline:
# tail		Just the last 200 (or slightly less after the grep)
# grep		... just the requests out of that
# cat | sort	... put into reverse order
# sed		... remove the quotes and square brackets
# awk		... print the IP address twice, timestamp, and requested path
# sed		... remove the first 3 dots to split first version of IP
#			address into octets, and remove any characters that
#			could cause trouble when inserted into this page
# I need to use the client IP address, field #5 at that point, to call
# geoiplookup.  So, send the initial pipeline into a while loop that
# assigns variables, sets a new variable, and then echoes the resulting
# collection into awk.
tail -200 /var/www/logs/access_log |
	grep 'GET.*200' |
	cat -n | sort -nr |
	sed -e 's/"/ /g' -e 's/\[//g' -e 's/\]//g' |
	awk '{print $2, $2, $5, $8}' |
	sed -e 's/\./ /' -e 's/\./ /' -e 's/\./ /' -e 's/[<>]//g' |
	while read IP1 IP2 IP3 IP4 CLIENTIP TIMESTAMP URL
	do
		COUNTRY=$( geoiplookup $CLIENTIP |
				sed 's/.*Edition: //' |
				sed 's/IP Address not found/Unknown/' )
		echo $IP1 $IP2 $IP3 $IP4 $CLIENTIP $COUNTRY $TIMESTAMP $URL |
		awk '{
			ip1 = $1;
			ip2 = $2;
			ip3 = $3;
			chroma = 0.75;
			hue = 6*(ip1*255*255 + ip2*255 + ip3)/(255*255*255);
			if (hue%2 > 1) {
				x = chroma*(1.0 - (hue%2 - 1));
			} else {
				x = chroma*(1.0 - (1 - hue%2));
			}
			if (hue < 1.0) {
				r = chroma;
				g = x;
				b = 0;
			} else if (hue < 2.0) {
				r = x;
				g = chroma;
				b = 0;
			} else if (hue < 3.0) {
				r = 0;
				g = chroma;
				b = x;
			} else if (hue < 4.0) {
				r = 0;
				g = x;
				b = chroma;
			} else if (hue < 5.0) {
				r = x;
				g = 0;
				b = chroma;
			} else {
				r = chroma;
				g = 0;
				b = x;
			}
			r = (r + 0.25)*255;
			g = (g + 0.25)*255;
			b = (b + 0.25)*255;

			printf("<div class=\"col-12 textleft\" ");
			printf("style=\"color:#000; background:#%02x%02x%02x;\"> ", r, g, b);
			for (i = 5; i <= NF; i++) {
				printf("%s ", $i);
			}
			printf("</div>\n");
		}'
	done 

Other Pages