I am getting the value of below parameters as null:
%REQ(X-B3-Traceid)%
, %REQ(X-Amzn-Trace-Id)%
, %REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%
, %REQ(:METHOD)%
Below is my configuration:
mesh: |-
accessLogFile: /dev/stdout
accessLogEncoding: JSON
accessLogFormat: |
{"start_time":"%START_TIME%","method":"%REQ(:METHOD)%","path":"%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%","protocol":"%PROTOCOL%","response_code":"%RESPONSE_CODE%","bytes_received":"%BYTES_RECEIVED%","bytes_sent":"%BYTES_SENT%","duration":"%DURATION%","upstream_service_time":"%RESP(X-ENVOY-UPSTREAM-SERVICE-TIME)%","user_agent":"%REQ(USER-AGENT)%","upstream_host":"%UPSTREAM_HOST%","upstream_transport_failure_reason":"%UPSTREAM_TRANSPORT_FAILURE_REASON%","traceID":"%REQ(X-B3-Traceid)%","amazonTraceId":"%REQ(X-Amzn-Trace-Id)%"}
defaultConfig:
discoveryAddress: istiod.istio-system.svc:15012
proxyMetadata: {}
tracing:
sampling: 100.0
zipkin:
address: $(HOST_IP):9411
enablePrometheusMerge: true
enableTracing: true
rootNamespace: istio-system
trustDomain: cluster.local
meshNetworks: 'networks: {}'
I am able to see the bytes_sent, bytes_received, start_time but not method, response_code, x-b3-traceid, etc which are part of the headers I think. Can you help me where I am going wrong.
Below is the output:
{"traceID":null,"duration":10018,"upstream_service_time":null,"upstream_transport_failure_reason":null,"amazonTraceId":null,"bytes_sent":266,"response_code":0,"user_agent":null,"method":null,"path":null,"bytes_received":183,"start_time":"2021-11-17T15:14:31.960Z","upstream_host":"192.168.0.215:8200","protocol":null}
{"upstream_service_time":null,"traceID":null,"response_code":0,"duration":10018,"protocol":null,"method":null,"upstream_host":"192.168.0.215:8200","upstream_transport_failure_reason":null,"user_agent":null,"bytes_sent":235,"start_time":"2021-11-17T15:14:31.960Z","path":null,"amazonTraceId":null,"bytes_received":880}
{"traceID":null,"upstream_host":"192.168.0.215:8200","duration":15003,"upstream_transport_failure_reason":null,"path":null,"method":null,"user_agent":null,"start_time":"2021-11-17T15:15:01.973Z","bytes_sent":191,"bytes_received":900,"amazonTraceId":null,"upstream_service_time":null,"protocol":null,"response_code":0}