https://github.com/eyolas/kong-plugin-http-log-advanced
PLUGIN KONG: Send request and response logs to multiple HTTP servers with body and multiple configuration.
https://github.com/eyolas/kong-plugin-http-log-advanced
Last synced: 10 months ago
JSON representation
PLUGIN KONG: Send request and response logs to multiple HTTP servers with body and multiple configuration.
- Host: GitHub
- URL: https://github.com/eyolas/kong-plugin-http-log-advanced
- Owner: eyolas
- Created: 2021-02-17T09:38:13.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-02-23T14:15:20.000Z (over 5 years ago)
- Last Synced: 2025-04-02T22:04:30.254Z (about 1 year ago)
- Language: Lua
- Size: 14.6 KB
- Stars: 4
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Kong http log advanced
Send request and response logs to multiple HTTP servers.
With many configuration + body
## Installation
WIP
## Configuration
You can add the plugin on top of an API by executing the following request on your Kong server:
```sh
$ http POST :8001/services/{api}/plugins name=middleman-advanced config:='{ "services": [{"url": "http://myserver.io/validate", "timeout": 10000, "keepalive": 60000}]}'
```
form parameter
default
description
name
The name of the plugin to use, in this case: middleman
config.services
required
The list of services witch the plugin make a JSON POST
### Service config
form parameter
default
description
url
required
The URL to which the plugin will make a JSON POST request before proxying the original request.
timeout
10000
Timeout (miliseconds) for the request to the URL specified above. Default value is 10000.
keepalive
60000
Keepalive time (miliseconds) for the request to the URL specified above. Default value is 60000.
include_cert
false
Include the original certificate in JSON POST
include_credential
false
Include the credential in JSON POST
include_consumer
false
Include the consumer in JSON POST
include_route
false
Include the route in JSON POST
Middleman will execute a JSON POST request to the specified url with the following body:
## Payload
```lua
local payload = {
['certificate'] = certificate,
['consumer'] = consumer,
['credential'] = credential,
['kong_routing'] = kong_routing,
['message'] = message,
['request'] = {
['headers'] = headers,
['params'] = params,
['body'] = json_body,
}
}
```
Attribute
Description
certificate
The certificate of the original request if include_credential
see resty_kong_tls.get_full_client_certificate_chain()
consumer
The consumer of the original request
see kong.client.get_consumer()
credential
The consumer of the original request
see kong.client.get_credential()
kong_routing
The kong_routing of the original request
see kong.router.get_route() and kong.router.get_service()
request
The request of the original request
see the next table : request
message
The original log send by kong
see basic_serializer.serialize(ngx)
Request
Attribute
Description
body
The body of the original request
params
The url arguments of the original request
headers
The headers of the original request
## Author
David TOUZET
## License
The MIT License (MIT)
=====================
Copyright (c) 2020-2021 David TOUZET
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.