matomo-org / matomo-log-analytics

Import any kind of server logs in Matomo for powerful log analytics. Universal log file parsing and reporting.
https://matomo.org/log-analytics/
GNU General Public License v3.0
224 stars 118 forks source link

Create a format for a2 hosting log #342

Open Chardonneaur opened 1 year ago

Chardonneaur commented 1 year ago

The format of A2 hosting log are quite similar to OVH, here is an example of A2 hosting log format: 54.0.0.0 - - [01/Dec/2022:08:31:01 -0500] "GET / HTTP/1.1" 200 304 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36"

sgiehl commented 1 year ago

Isn't A2 using some default log format? Did you try letting the log parser detect the format?

Chardonneaur commented 1 year ago

I did, but it was written url are undefined

sgiehl commented 1 year ago

In that case, guess it should work by providing a custom regex. Unfortunately I don't think we will be able to work on any improvements for the log importer any time soon.

Chardonneaur commented 1 year ago

could you guide me to write this custom regex?

sgiehl commented 1 year ago

Those are some of the current formats, hope that helps to create a custom one: https://github.com/matomo-org/matomo-log-analytics/blob/33ba65586d45aa877bb78462f78a4381b6dd772a/import_logs.py#L456-L491