Replies: 2 comments 3 replies
-
要将APISIX的全部访问日志接入到Elasticsearch,而不需要为每个路由单独配置,可以通过在APISIX的全局插件配置中启用 以下是一个示例配置,展示如何在全局启用 curl http://127.0.0.1:9180/apisix/admin/plugin_metadata/elasticsearch-logger \
-H "X-API-KEY: $admin_key" -X PUT -d '
{
"log_format": {
"host": "$host",
"@timestamp": "$time_iso8601",
"client_ip": "$remote_addr"
}
}' 通过这种方式, |
Beta Was this translation helpful? Give feedback.
3 replies
-
You should be able to configure the plugin on a "global rule" resource, which is the global plugin configuration. After that all traffic should be logged, instead of a specific route. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
elasticsearch-logger 插件我看要配合指定路由才能用,我不想单一配置,不能把全部经过网关的请求都发到es吗?
Beta Was this translation helpful? Give feedback.
All reactions