diff --git a/quick_debug_with_envoyfilter/ef-quickdebug.yaml b/quick_debug_with_envoyfilter/ef-quickdebug.yaml index 9056759..55a019f 100644 --- a/quick_debug_with_envoyfilter/ef-quickdebug.yaml +++ b/quick_debug_with_envoyfilter/ef-quickdebug.yaml @@ -14,32 +14,36 @@ spec: listener: filterChain: filter: - name: envoy.http_connection_manager + name: envoy.filters.network.http_connection_manager subFilter: - name: envoy.router + name: envoy.filters.http.router patch: operation: INSERT_BEFORE value: - config: + typed_config: + "@type": "type.googleapis.com/envoy.extensions.filters.http.lua.v3.Lua" inlineCode: | function envoy_on_request(request_handle) request_handle:logInfo("******* Enter debug logs - envoy_on_request") + request_handle:logInfo("******* request header") local headers = request_handle:headers() for key,value in pairs(headers) do request_handle:logInfo(key.." "..value) end + request_handle:logInfo("******* request body") for chunk in request_handle:bodyChunks() do request_handle:logInfo(chunk:getBytes(0,chunk:length())) end - + end function envoy_on_response(response_handle) response_handle:logInfo("******* Enter debug logs - envoy_on_response") + response_handle:logInfo("******* response header") local pheaders = response_handle:headers() for key,value in pairs(pheaders) do response_handle:logInfo(key.." "..value) end + response_handle:logInfo("******* response body") for chunk in response_handle:bodyChunks() do response_handle:logInfo(chunk:getBytes(0,chunk:length())) end - end name: envoy.lua