Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Jun 30, 2021

Conversation

chzhuo
Copy link
Contributor

@chzhuo chzhuo commented Jun 25, 2021

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

apisix/plugins/kafka-logger.lua Show resolved Hide resolved
docs/zh/latest/plugins/kafka-logger.md Outdated Show resolved Hide resolved
t/plugin/kafka-logger.t Outdated Show resolved Hide resolved
t/plugin/kafka-logger.t Outdated Show resolved Hide resolved
@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
apisix/utils/log-util.lua Outdated Show resolved Hide resolved
apisix/plugins/http-logger.lua Outdated Show resolved Hide resolved
apisix/plugins/kafka-logger.lua Outdated Show resolved Hide resolved
@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