Disable accesslog through EnvoyFilters CRD

225 Views Asked by At

The normal way is setting empty string through meshConfig.accessLogFile. but i don't have the permission to update the global config. So I try to disabled accesslog through EnvoyFilter CRD.

apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
  name: disable-accesslog
spec:
  configPatches:
  - applyTo: NETWORK_FILTER
    match:
      listener:
        filterChain:
          filter:
            name: "envoy.filters.network.http_connection_manager"
    patch:
      operation: MERGE
      value:
        typed_config:
          "@type": "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager"
          access_log:
          - name: envoy.access_loggers.file
            typed_config:
              "@type": "type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog"
              path: ""

unfortunately, I got the error message:

2022-07-25T10:03:29.923757Z warning envoy config    gRPC config for type.googleapis.com/envoy.config.listener.v3.Listener rejected: Error adding/updating listener(s) 0.0.0.0_15014: Proto constraint validation failed (FileAccessLogValidationError.Path: value length must be at least 1 characters): 
1

There are 1 best solutions below

0
Peter Claes On

Perhaps you can use /dev/null in path