Closed sfinke0 closed 1 year ago
After running lancache at home with JSON logs enabled for a week I got some dashboards working in Grafana and Kibana. Datasource is Opensearch ☺️
Yes is looking really cool, cant wait to get it. Can you please make sure to include config files and instructions how to set it up too.
Any News here?
Hi @VibroAxe, could you have a look please? Our upcoming LAN party with ~400 guests will be next month already and I would really like to use the official docker image, instead of having to build one myself.
I'm happy to discuss any issues of concern.
Cheers Sebastian
Lgtm thanks for the input. Merged now, I'd be interested to see some setup instructions added to the documentation site if you could fit grafana
@sfinke0
hey do you have a dashboard to share? So I don’t have to start at zero
Hi @bonkersGER,
I can share my simple Grafana dashboard shown in the screenshot above. Just came back from a Lanparty this weekend and will write documentation about log analysis in the coming weeks for the Lancache website.
Cheers.
Hi there,
to prevent having additional work on the logs parsing side, I thought it would be nice to have nginx directly emit JSON logs. I added an additional
log_format
which is set tocachelog
as the default and can now be set tocachelog-json
via theNGINX_LOG_FORMAT
environment variable.Here is an example of what the JSON access logs look like:
``` {"timestamp":"1676882165.157","time_local":"20/Feb/2023:09:36:05 +0100","cache_identifier":"steam","remote_addr":"10.160.7.124","forwarded_for":"","remote_user":"","status":"200","bytes_sent":333728,"referer":"","user_agent":"Valve/Steam HTTP Client 1.0","upstream_cache_status":"HIT","host":"cache6-fra2.steamcontent.com","http_range":"","method":"GET","path":"/depot/621/chunk/3b267b871cf5e6b97a5f82bc4dbafc426c0d198e","proto":"HTTP/1.1","scheme":"http"} {"timestamp":"1676883410.966","time_local":"20/Feb/2023:09:56:50 +0100","cache_identifier":"blizzard","remote_addr":"10.160.7.124","forwarded_for":"","remote_user":"","status":"206","bytes_sent":2383,"referer":"","user_agent":"","upstream_cache_status":"HIT","host":"level3.blizzard.com","http_range":"bytes=0-2382","method":"GET","path":"/tpr/ovw/patch/90/91/9091ec25b9acaf4b1113be387151a61e","proto":"HTTP/1.1","scheme":"http"} {"timestamp":"1676885073.633","time_local":"20/Feb/2023:10:24:33 +0100","cache_identifier":"epicgames","remote_addr":"10.160.7.124","forwarded_for":"","remote_user":"","status":"403","bytes_sent":110,"referer":"","user_agent":"EpicGamesLauncher/14.6.1-24267999+++Portal+Release-Live Windows/10.0.22621.1.256.64bit","upstream_cache_status":"MISS","host":"download.epicgames.com","http_range":"","method":"GET","path":"/Builds/Org/o-37m6jbj5wcvrcvm4wusv7nazdfvbjk/fbb7b5df655a4b07ad280fec947d0d9f/default/pqhHqDkaRBRz08hzTUy_rMfA4PCcQw.manifest?Policy=eyJTdGF0ZW1lbnQiOiBbeyJSZXNvdXJjZSI6IiovQnVpbGRzL09yZy9vLTM3bTZqYmo1d2N2cmN2bTR3dXN2N25hemRmdmJqay9mYmI3YjVkZjY1NWE0YjA3YWQyODBmZWM5NDdkMGQ5Zi9kZWZhdWx0L3BxaEhxRGthUkJSejA4aHpUVXlfck1mQTRQQ2NRdy5tYW5pZmVzdCIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTY3Njg4NTM3M30sIklwQWRkcmVzcyI6eyJBV1M6U291cmNlSXAiOiIwLjAuMC4wLzAifX19XX0_&Signature=7iWms7T7n3r3SyOa3wg6cD5RAyml8HpU0het1jbZoEK2YmtLHmCyjzejvC3gGwFAuLuVYyTWvgzHFejwXBVA8QeW-n5bYcOq2tXY0G5CjHCksL83JAl0RkW3FiAp69e9phYm0V6Q8ZYltV8AH8n50PoIhFvsp~WNnkEpVQW6aQRyUhTa7Gd3N9v3haPdb9Yw9MsNJsA~4b6TGCKPGre~hndpwQCRv-ZA-ZXEEkHsfZ3-iiWl6F4aU6lz2NCAgwNxzswxvGlGqhNZeRmNIdDZ1R9xbw37-bNRhyljqqojpiQ7jBPrJb0S2cPlsQgj5rji33lev6IpyAu4d2kQ6Z-Gcg__&Key-Pair-Id=APKAJP7WU44FM4EHJYFQ","proto":"HTTP/1.1","scheme":"http"} {"timestamp":"1676883213.860","time_local":"20/Feb/2023:09:53:33 +0100","cache_identifier":"wsus","remote_addr":"10.160.7.124","forwarded_for":"","remote_user":"","status":"304","bytes_sent":0,"referer":"","user_agent":"Microsoft-CryptoAPI/10.0","upstream_cache_status":"","host":"ctldl.windowsupdate.com","http_range":"","method":"GET","path":"/msdownload/update/v3/static/trustedr/en/authrootstl.cab?6483b98637265188","proto":"HTTP/1.1","scheme":"http"} ```Please have a look and let me know if I can improve something or where this could be documented for others to see.
Thanks in advance Sebastian
EDIT: changed "bytes_sent" from string value to numeric value to have out of the box support for aggregation e.g. in Opensearch