Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I offer a working regex for default Nginx Proxy Manager log #345

Open
antoninchadima opened this issue Jan 27, 2023 · 1 comment
Open

I offer a working regex for default Nginx Proxy Manager log #345

antoninchadima opened this issue Jan 27, 2023 · 1 comment

Comments

@antoninchadima
Copy link

antoninchadima commented Jan 27, 2023

https://nginxproxymanager.com/

nginx.conf:
https://github.com/NginxProxyManager/nginx-proxy-manager/blob/develop/docker/rootfs/etc/nginx/nginx.conf
log_format proxy '[$time_local] $upstream_cache_status $upstream_status $status - $request_method $scheme $host "$request_uri" [Client $remote_addr] [Length $body_bytes_sent] [Gzip $gzip_ratio] [Sent-to $server] "$http_user_agent" "$http_referer"'

example:
[27/Jan/2023:10:22:32 +0000] - 200 200 - POST https data.ucl.cas.cz "/apps/text/session/sync" [Client 147.231.80.67] [Length 251] [Gzip -] [Sent-to data.localdomain] "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36" "-"

regex:
\[(?P<date>.*?) (?P<timezone>.*?)\] \S+ \S+ (?P<status>\S+) \- (?P<method>\S+) \S+ (?P<host>[\w\-\.]*) \"(?P<path>.*?)\" \[Client (?P<ip>[\w*.:-]+)\] \[Length (?P<length>\S+)\].*? \"(?P<user_agent>.*?)\" \"(?P<referrer>.*?)\"

@hanscees
Copy link

hanscees commented Jun 7, 2023

have you actually succeeded in importing these data?
In my trial and error no ip-addresses are recorded other than 0.0.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants