WinNetFlow
WinNetFlow는 Windows Event Tracing(ETW)으로 Microsoft-Windows-TCPIP Provider의 TCP/UDP 이벤트를 수신하고 프로세스별 계층 4 트래픽(바이트, 패킷, 재전송, RTT, TCP 상태)을 집계합니다. 핵심 필드와 엔드포인트 역할은 Linux ebpf-net/netflow와 호환되어 src/dst, client/server, conn_side 및 트래픽 필드 기반 호스트 네트워크 화면을 재사용할 수 있습니다.
Microsoft-Windows-HttpService Provider에서도 HTTP 요청 메트릭(httpflow, 기본 활성화)을 수집합니다. IIS, HttpListener, ASP.NET Core 등 HTTP.sys 기반 서비스를 지원하며 필드는 Linux ebpf-net/httpflow와 호환됩니다.
구성¶
사전 요구 사항¶
- OS: Windows 10 / Windows Server 2016 이상(64비트)
- 관리자 권한으로 실행해야 함(실시간 ETW 세션 생성에 필요)
- eBPF 수집기와 독립적으로 활성화할 수 있으며 같은 호스트에서는 둘 중 하나만 활성화됨
DataKit 설치 디렉터리의 conf.d/samples에서 winnetflow.conf.sample을 복사하여 winnetflow.conf로 이름을 바꿉니다. 예:
[[inputs.winnetflow]]
# Flow aggregation and report interval.
interval = "60s"
# Optional ETW session tuning. Buffer size is in KB; unsafe values are
# clamped to documented limits and a 256 MiB per-session memory budget.
# etw_buffer_size_kb = 64
# etw_min_buffers = 8
# etw_max_buffers = 256
# Max flows tracked per interval; excess new flows are dropped and counted.
# max_flows = 65536
# Collect L7 HTTP request metrics from the HTTP.sys ETW provider (IIS,
# HttpListener and other HTTP.sys clients) as the "httpflow" measurement.
# enable_httpflow = true
# Max in-flight HTTP requests tracked; excess new requests are dropped and
# counted in the periodic summary.
# max_http_requests = 65536
# Max request path length collected; longer paths are truncated and flagged.
# httpflow_path_limit = 256
[inputs.winnetflow.tags]
# some_tag = "some_value"
구성 후 DataKit을 다시 시작합니다.
ConfigMap 구성 주입 또는 ENV_DATAKIT_INPUTS 구성으로 수집기를 활성화할 수 있습니다.
환경 변수로도 구성 매개변수를 변경할 수 있습니다(ENV_DEFAULT_ENABLED_INPUTS에 기본 수집기로 추가해야 함):
-
ENV_INPUT_WINNETFLOW_INTERVAL
수집기 반복 간격
필드 유형: Duration
수집기 구성 필드:
interval기본값: 10s
-
ENV_INPUT_WINNETFLOW_ETW_BUFFER_SIZE_K_B
ETW 세션 버퍼 크기(KB, 4~1024).
필드 유형: Int
수집기 구성 필드:
etw_buffer_size_k_b예: 64
-
ENV_INPUT_WINNETFLOW_ETW_MIN_BUFFERS
ETW 세션 최소 버퍼 수(2~4096).
필드 유형: Int
수집기 구성 필드:
etw_min_buffers예: 8
-
ENV_INPUT_WINNETFLOW_ETW_MAX_BUFFERS
ETW 세션 최대 버퍼 수. 세션당 256 MiB 메모리 예산으로도 제한됩니다.
필드 유형: Int
수집기 구성 필드:
etw_max_buffers예: 256
-
ENV_INPUT_WINNETFLOW_MAX_FLOWS
주기당 최대 동시 흐름 수. 초과분은 버리고 집계합니다.
필드 유형: Int
수집기 구성 필드:
max_flows예: 65536
-
ENV_INPUT_WINNETFLOW_ENABLE_HTTP_FLOW
HTTP.sys ETW Provider의 L7 httpflow 수집 활성화 여부.
필드 유형: Boolean
수집기 구성 필드:
enable_http_flow예: true
-
ENV_INPUT_WINNETFLOW_MAX_HTTP_REQUESTS
추적할 최대 동시 진행 HTTP 요청 수. 초과분은 버리고 집계합니다.
필드 유형: Int
수집기 구성 필드:
max_http_requests예: 65536
-
ENV_INPUT_WINNETFLOW_HTTP_FLOW_PATH_LIMIT
수집할 요청 경로 최대 길이. 초과하면 잘라내고 표시합니다.
필드 유형: Int
수집기 구성 필드:
http_flow_path_limit예: 256
-
ENV_INPUT_WINNETFLOW_TAGS
사용자 정의 tag. 구성 파일에 같은 이름이 있으면 덮어씁니다.
필드 유형: String
수집기 구성 필드:
tags예:
'tag1=value1,tag2=value2'
메트릭¶
다음 데이터에는 전역 tag host(DataKit 호스트 이름)를 기본 추가합니다. [inputs.winnetflow.tags]로 다른 tag도 지정할 수 있습니다:
| Tags & Fields | Description |
|---|---|
| client_ip ( tag) |
Client endpoint IP address. |
| client_ip_type ( tag) |
Client IP type: private, loopback, multicast or other. |
| client_port ( tag) |
Client endpoint port. |
| conn_side ( tag) |
Local connection role: client or server. |
| direction ( tag) |
Flow direction: incoming or outgoing. |
| dst_ip ( tag) |
Destination IP address. |
| dst_ip_type ( tag) |
Destination IP type: private, loopback, multicast or other. |
| dst_nat_ip ( tag) |
Destination NAT IP; N/A because Windows ETW does not expose NAT translation. |
| dst_nat_port ( tag) |
Destination NAT port; N/A because Windows ETW does not expose NAT translation. |
| dst_port ( tag) |
Destination port. |
| family ( tag) |
IP family: IPv4 or IPv6. |
| pid ( tag) |
Process ID owning the connection. |
| process_name ( tag) |
Process name owning the connection. |
| server_ip ( tag) |
Server endpoint IP address. |
| server_ip_type ( tag) |
Server IP type: private, loopback, multicast or other. |
| server_port ( tag) |
Server endpoint port. |
| src_ip ( tag) |
Source IP address. |
| src_ip_type ( tag) |
Source IP type: private, loopback, multicast or other. |
| src_port ( tag) |
Source port. |
| transport ( tag) |
Transport protocol: tcp or udp. |
| bytes_read | Bytes read on this flow during the interval. Type: int | (gauge) Unit: digital,B |
| bytes_written | Bytes written on this flow during the interval. Type: int | (gauge) Unit: digital,B |
| client_sent | Bytes sent by the client during the interval. Type: int | (gauge) Unit: digital,B |
| packets_read | Packets read on this flow during the interval (approximate on Windows). Type: int | (gauge) Unit: count |
| packets_written | Packets/messages written during the interval; always 0 for TCP because TCPIP send events do not expose a packet count, and approximated by message count for UDP. Type: int | (gauge) Unit: count |
| retransmits | TCP retransmissions on this flow during the interval. Type: int | (gauge) Unit: count |
| rtt | Average smoothed TCP RTT in microseconds. Type: int | (gauge) Unit: time,μs |
| rtt_var | Average TCP RTT variance in microseconds. Type: int | (gauge) Unit: time,μs |
| server_sent | Bytes sent by the server during the interval. Type: int | (gauge) Unit: digital,B |
| tcp_close_wait | TCP transitions into CLOSE_WAIT state during the interval. Type: int | (gauge) Unit: count |
| tcp_closed | TCP connections closed during the interval. Type: int | (gauge) Unit: count |
| tcp_connect_attempts | TCP active connect attempts during the interval. Type: int | (gauge) Unit: count |
| tcp_connect_failures | TCP active connect failures during the interval. Type: int | (gauge) Unit: count |
| tcp_established | TCP connections established during the interval. Type: int | (gauge) Unit: count |
| tcp_last_ack | TCP transitions into LAST_ACK state during the interval. Type: int | (gauge) Unit: count |
| tcp_time_wait | TCP transitions into TIME_WAIT state during the interval. Type: int | (gauge) Unit: count |
| Tags & Fields | Description |
|---|---|
| client_ip ( tag) |
Client endpoint IP address. |
| client_ip_type ( tag) |
Client IP type: private, loopback, multicast or other. |
| client_port ( tag) |
Client endpoint port. |
| conn_side ( tag) |
Local connection role, always server for HTTP.sys. |
| direction ( tag) |
Flow direction, always incoming for the HTTP.sys server side. |
| dst_ip ( tag) |
Client IP address (remote endpoint). |
| dst_ip_type ( tag) |
Client destination IP type: private, loopback, multicast or other. |
| dst_nat_ip ( tag) |
Destination NAT IP; N/A because Windows ETW does not expose NAT translation. |
| dst_nat_port ( tag) |
Destination NAT port; N/A because Windows ETW does not expose NAT translation. |
| dst_port ( tag) |
Client port. |
| family ( tag) |
IP family: IPv4 or IPv6. |
| pid ( tag) |
Server process ID reported by HTTP.sys on the response event. |
| process_name ( tag) |
Server process name resolved from the HTTP.sys response event PID (for example, w3wp.exe). |
| server_ip ( tag) |
Server endpoint IP address. |
| server_ip_type ( tag) |
Server IP type: private, loopback, multicast or other. |
| server_port ( tag) |
Server endpoint port. |
| src_ip ( tag) |
Server IP address (local endpoint). |
| src_ip_type ( tag) |
Server source IP type: private, loopback, multicast or other. |
| src_port ( tag) |
Server port. |
| transport ( tag) |
Transport protocol, always tcp. |
| bytes_read | Bytes read on this flow during the interval (always 0; HTTP.sys does not expose request body sizes). Type: int | (gauge) Unit: digital,B |
| bytes_written | Bytes written on this flow during the interval (populated for cache-served responses). Type: int | (gauge) Unit: digital,B |
| client_sent | Bytes sent by the HTTP client; always 0 because HTTP.sys does not expose request body sizes. Type: int | (gauge) Unit: digital,B |
| count | Number of HTTP requests in this group during the interval. Type: int | (gauge) Unit: count |
| http_version | HTTP version; empty because HTTP.sys events do not carry it. Type: string | (string) Unit: N/A |
| latency | Average request processing time (receive to send complete) in nanoseconds. Type: int | (gauge) Unit: time,ns |
| method | HTTP method (GET/POST/...). Type: string | (string) Unit: N/A |
| path | Request path. Type: string | (string) Unit: N/A |
| server_sent | Bytes sent by the HTTP server during the interval. Type: int | (gauge) Unit: digital,B |
| status_code | HTTP response status code. Type: int | (gauge) Unit: N/A |
| truncated | Request path reached the configured length limit and was truncated. Type: bool | (gauge) Unit: bool |
알려진 제한 사항¶
- TCP 송신 이벤트에는 패킷 수가 없으므로 TCP의
packets_written은 항상 0입니다. UDP는 메시지 수로 패킷 수를 근사합니다. - UDP에는 연결 의미가 없습니다. 비임시 포트에 바인딩된 소켓으로 방향을 추정하며 수신 대기 포트와 일치하면
incoming, 아니면outgoing입니다. - 수집 시작 전 TCP 연결은 로컬 TCP 수신 대기 포트 스냅샷으로 방향을 판단합니다. 일치하면
incoming, 아니면outgoing이며 스냅샷은 30초마다 갱신합니다. - Windows ETW는 네트워크 네임스페이스, Kubernetes 엔드포인트 메타데이터, DNS 또는 NAT 정보를 제공하지 않습니다.
dst_nat_ip와dst_nat_port는N/A로 고정되며 필요한 Kubernetes/네임스페이스 tag는 별도 전역 tag로 추가하세요. - 트래픽이 많으면 ETW 이벤트가 손실될 수 있습니다. 수집기는 10분마다 세션 통계(디코딩, 폐기, 파싱 오류, 세션 손실)를 출력하고 이상 시 경고 로그를 기록합니다.
- 주기당 흐름 수는 제한됩니다(기본 65536,
max_flows). 연결 폭증 시 초과한 새 흐름은 버리고flows_skipped에 집계합니다. httpflow는 HTTP.sys를 통하는 HTTP만 수집합니다(IIS/HttpListener/ASP.NET Core 등). 일부 Go/Node 서비스처럼 자체 소켓을 사용하는 서비스는 수집하지 않습니다.- HTTP.sys 이벤트에는 HTTP 버전과 요청 본문 크기가 없습니다.
http_version은 항상 비어 있고bytes_read는 0이며bytes_written은 캐시 적중 응답(event 16)에서만 얻을 수 있습니다. - HTTP 프로세스 식별은 최선의 노력 방식입니다. 연결 이벤트의 PID는 클라이언트 것이므로 무시하고 HTTP.sys 응답 시 서버 PID를 확인합니다. 이름을 읽기 전에 프로세스가 종료되면
process_name이unknown일 수 있습니다. - 동시 HTTP 요청 수는 제한됩니다(기본 65536,
max_http_requests). 초과 요청은 버리고 주기별 요약 로그에 집계합니다. 민감 정보 노출과 무제한 카디널리티를 방지하기 위해 URL 쿼리 매개변수는 수집하지 않습니다. 경로가httpflow_path_limit(기본 256)을 넘으면 잘라내고truncated를 설정합니다.