Ceci est une ancienne révision du document !
Pour parser les acces Log Nginx il est préférable de modifier le fichier /etc/nginx/nginx.conf :
on modifie le format, ainsi que la destinationd des fichiers:
## # Logging Settings ## log_format perso '$time_local | ' '$status | ' '$http_x_forwarded_for | ' '$remote_addr | ' '$remote_user | ' '$body_bytes_sent | ' '$http_referer | ' '$request | ' '$http_user_agent'; access_log /home/pi/logs/nginx/access.log perso; error_log /home/pi/logs/nginx//error.log;
et voici le résultat:
05/Mar/2022:10:57:30 +0100 | 200 | - | 192.168.1.79 | - | 5 | - | GET /meteo/php/logs.php?Host=ESP-16&Sondes=Wind&Alim=Secteur&Type=Meteo&Script=ESPWind-4.201&SSID=FREE_33PA&Signal=-81&IPAdresse=192.168.1.79&Vent=2.51&Rafale=3.23&Compas=279 HTTP/1.1 | ESP8266HTTPClient 05/Mar/2022:10:57:40 +0100 | 200 | - | 192.168.6.111 | - | 5 | - | GET /meteo/php/logs.php?Host=ESP-15&Sondes=Pluvio&Alim=Secteur&Type=Meteo&Script=ESPPluvio-4.201&SSID=SynologyRT&Signal=-69&IPAdresse=192.168.6.111&PluRel=0.00&PluInt=0.00 HTTP/1.1 | ESP8266HTTPClient 05/Mar/2022:10:58:00 +0100 | 200 | - | 192.168.1.79 | - | 5 | - | GET /meteo/php/logs.php?Host=ESP-16&Sondes=Wind&Alim=Secteur&Type=Meteo&Script=ESPWind-4.201&SSID=FREE_33PA&Signal=-81&IPAdresse=192.168.1.79&Vent=0.89&Rafale=2.42&Compas=166 HTTP/1.1 | ESP8266HTTPClient 05/Mar/2022:10:58:11 +0100 | 200 | - | 192.168.6.89 | - | 5 | - | GET /meteo/php/logs.php?Host=ESP-04&Tmp=9.72&Hum=69.01&TBME=11.44&HBME=67.75&PR=1021.21&PA=1012.88 HTTP/1.1 | ESP8266HTTPClient