Skip to content

feat(kafka-logger): support for specified the log formats via admin API.#4483

Merged
moonming merged 3 commits into
apache:masterfrom
chzhuo:feat-kafka-logger-log-format
Jun 30, 2021
Merged

feat(kafka-logger): support for specified the log formats via admin API.#4483
moonming merged 3 commits into
apache:masterfrom
chzhuo:feat-kafka-logger-log-format

Conversation

@chzhuo

@chzhuo chzhuo commented Jun 25, 2021

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

as title.

For example:

curl http://****/apisix/admin/plugin_metadata/kafka-logger -d '
{
    "log_format": {
        "host": "$host",
        "@timestamp": "$time_iso8601",
        "client_ip": "$remote_addr"
    }
}'

when we enabled plugin http-logger, we will get the message body like:

{"host":"localhost","@timestamp":"2020-09-23T18:29:07-04:00","client_ip":"127.0.0.1","route_id":"1"}
{"host":"localhost","@timestamp":"2020-09-23T18:29:07-04:00","client_ip":"127.0.0.1","route_id":"1"}

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

Comment thread apisix/plugins/kafka-logger.lua
Comment thread docs/zh/latest/plugins/kafka-logger.md Outdated
Comment thread t/plugin/kafka-logger.t Outdated
Comment thread t/plugin/kafka-logger.t Outdated
@chzhuo
chzhuo force-pushed the feat-kafka-logger-log-format branch from 8a849d9 to 4856e3b Compare June 28, 2021 06:20
@chzhuo
chzhuo force-pushed the feat-kafka-logger-log-format branch from 4856e3b to 2c5845a Compare June 28, 2021 07:47
Comment thread apisix/utils/log-util.lua Outdated
Comment thread apisix/plugins/http-logger.lua Outdated
Comment thread apisix/plugins/kafka-logger.lua Outdated
Comment thread docs/zh/latest/plugins/http-logger.md
@moonming
moonming merged commit 20d9dd2 into apache:master Jun 30, 2021
@chzhuo
chzhuo deleted the feat-kafka-logger-log-format branch June 30, 2021 07:18
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

Successfully merging this pull request may close these issues.

4 participants