access log: add header based filter (#616)

define a access log filter to filter requests based on the
value of a specified header.

This is the initial data plane api change for the issue envoyproxy/envoy#2544.

Signed-off-by: Kevin Chan <kchan@evernote.com>
pull/618/head
Kchan 7 years ago committed by Matt Klein
parent a33e174285
commit d7c5dd64ac
  1. 2
      envoy/config/filter/accesslog/v2/BUILD
  2. 11
      envoy/config/filter/accesslog/v2/accesslog.proto

@ -15,6 +15,7 @@ api_proto_library(
"//envoy/api/v2/core:address", "//envoy/api/v2/core:address",
"//envoy/api/v2/core:base", "//envoy/api/v2/core:base",
"//envoy/api/v2/core:grpc_service", "//envoy/api/v2/core:grpc_service",
"//envoy/api/v2/route",
"//envoy/type:percent", "//envoy/type:percent",
], ],
) )
@ -26,6 +27,7 @@ api_go_proto_library(
"//envoy/api/v2/core:address_go_proto", "//envoy/api/v2/core:address_go_proto",
"//envoy/api/v2/core:base_go_proto", "//envoy/api/v2/core:base_go_proto",
"//envoy/api/v2/core:grpc_service_go_proto", "//envoy/api/v2/core:grpc_service_go_proto",
"//envoy/api/v2/route:route_go_proto",
"//envoy/type:percent_go_proto", "//envoy/type:percent_go_proto",
], ],
) )

@ -5,6 +5,7 @@ option go_package = "v2";
import "envoy/api/v2/core/address.proto"; import "envoy/api/v2/core/address.proto";
import "envoy/api/v2/core/base.proto"; import "envoy/api/v2/core/base.proto";
import "envoy/api/v2/route/route.proto";
import "envoy/type/percent.proto"; import "envoy/type/percent.proto";
import "google/protobuf/duration.proto"; import "google/protobuf/duration.proto";
@ -331,6 +332,9 @@ message AccessLogFilter {
// Or filter. // Or filter.
OrFilter or_filter = 7; OrFilter or_filter = 7;
// [#not-implemented-hide:] Header filter.
HeaderFilter header_filter = 8;
} }
} }
@ -414,6 +418,13 @@ message OrFilter {
repeated AccessLogFilter filters = 2 [(validate.rules).repeated .min_items = 2]; repeated AccessLogFilter filters = 2 [(validate.rules).repeated .min_items = 2];
} }
// [#not-implemented-hide:] Filters requests based on the presence or value of a request header.
message HeaderFilter {
// Only requests with a header which matches the specified HeaderMatcher will pass the filter
// check.
envoy.api.v2.route.HeaderMatcher header = 1 [(validate.rules).message.required = true];
}
// Custom configuration for an AccessLog that writes log entries directly to a file. // Custom configuration for an AccessLog that writes log entries directly to a file.
// Configures the built-in *envoy.file_access_log* AccessLog. // Configures the built-in *envoy.file_access_log* AccessLog.
message FileAccessLog { message FileAccessLog {

Loading…
Cancel
Save