diff --git a/apisix/plugins/elasticsearch-logger.lua b/apisix/plugins/elasticsearch-logger.lua index a3114e98eab2..ac69525c7ed7 100644 --- a/apisix/plugins/elasticsearch-logger.lua +++ b/apisix/plugins/elasticsearch-logger.lua @@ -20,6 +20,7 @@ local http = require("resty.http") local log_util = require("apisix.utils.log-util") local bp_manager_mod = require("apisix.utils.batch-processor-manager") local plugin = require("apisix.plugin") +local fetch_secrets = require("apisix.secret").fetch_secrets local ngx = ngx local str_format = core.string.format local math_random = math.random @@ -252,6 +253,7 @@ local function send_to_elasticsearch(conf, entries) ["Accept"] = "application/vnd.elasticsearch+json" } if conf.auth then + conf = fetch_secrets(conf, true) local authorization = "Basic " .. ngx.encode_base64( conf.auth.username .. ":" .. conf.auth.password )