AWStats icon indicating copy to clipboard operation
AWStats copied to clipboard

+ allow processing logs in json

Open bayaro opened this issue 1 year ago • 0 comments

Nowadays in many cases it is more convenient to have logs in json. These changes allow process such logs without losing any previous functionality.

The new option is introduced - LogFormatJsonMap. This option should contain a json for mapping keys in log file into awstats's predefined keys. This configuration will be used only if the LogFormat will have the value json. Example:

LogFormat=json
LogFormatJsonMap={"host":"remote_addr","logname":"remote_user","time1":"time","method":"request_method","url":"request_uri","code":"status","size":"bytes_sent","referer":"http_referer","agent":"http_user_agent"}

NB. The are no direct correspondence of predefined keys and $pos_* variables. So LogFormatJsonMap should use suffixes from $pos_* variables. As example: instead of bytesd the key size should be used; instead of ua - agent.

bayaro avatar Jan 03 '24 17:01 bayaro