#!/usr/bin/env bash # eflag — Envoy/Istio response flag 주석기 (Istio 기본 TEXT 로그 포맷 전용) # usage: kubectl logs deploy/app -c istio-proxy --tail=200 | eflag declare -A DESC=( [UH]="endpoint 0개 (label 불일치·readiness)" [NC]="route가 가리키는 cluster 없음 (DR/host)" [NR]="매칭 route 없음 / filter chain 없음" [UF]="upstream 연결 수립 실패 (refused·mTLS·NetworkPolicy)" [UC]="응답 전 upstream이 연결 종료 (idle timeout 불일치)" [UR]="upstream remote reset (RST 수신)" [LR]="Envoy가 로컬에서 reset" [UO]="circuit breaker overflow (connectionPool 한도)" [URX]="retry 한도(HTTP)·connect 시도 한도(TCP) 초과" [UT]="upstream 응답 타임아웃 (VS timeout)" [DC]="downstream(client)이 먼저 끊음" [SI]="stream idle timeout" [UMSDR]="max stream duration 도달" [DT]="max connection duration 초과" [DPE]="downstream HTTP protocol error" [UPE]="upstream HTTP protocol error" [DF]="DNS 해석 실패" [RL]="local rate limit" [RLSE]="rate limit service 오류" [UAEX]="ext_authz 거부" [IH]="잘못된 요청 헤더 (400)" [LH]="local health check 실패" [OM]="overload manager 차단" [NFCF]="filter config warming 미완료" [DI]="fault injection delay (의도됨)" [FI]="fault injection abort (의도됨)" ) decode() { local f res="" IFS=',' read -ra fs <<< "$1" for f in "${fs[@]}"; do res+="${f}=${DESC[$f]:-unknown}; "; done printf '%s' "${res%; }" } while IFS= read -r line; do read -ra F <<< "$line" printf '%s\n' "$line" [[ "${F[5]}" != "-" && -n "${F[5]}" ]] && \ printf ' \xe2\x86\xb3 [%s] %s | details=%s\n' "${F[4]}" "$(decode "${F[5]}")" "${F[6]}" done