]> git.ipfire.org Git - thirdparty/AWStats.git/commit
+ allow processing logs in json 245/head
authorbaya <baya@andatra.kiev.ua>
Wed, 3 Jan 2024 16:49:49 +0000 (16:49 +0000)
committerbaya <baya@andatra.kiev.ua>
Wed, 3 Jan 2024 17:08:52 +0000 (17:08 +0000)
commit438762647377b38ad8d1176767c8abd4604d632c
tree8011a7859e38f7a24416487c39afe2b332b06243
parent5d2c7a0bec90e18627fe6f9430670d305481be15
+ allow processing logs in json

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`.
wwwroot/cgi-bin/awstats.pl