kfl
하는 일
Kubeshark에서 트래픽을 찾는 필터 언어인 KFL의 문법과 필드를 AI에 가르칩니다. 클러스터 트래픽을 검색하는 엔지니어를 위한 스킬입니다.
사용하는 경우
- ✓프로토콜, 포트, 필드로 Kubeshark 트래픽을 필터링하고 싶을 때.
- ✓특정 요청이나 응답과 일치하는 KFL 식이 필요할 때.
- ✓KFL 필터가 오류를 반환해서 고쳐야 할 때.
스킬 링크
https://github.com/kubeshark/kubeshark/blob/master/skills/kfl/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“포트 8080으로 가는 HTTP 요청만 보여 주는 Kubeshark 필터를 작성해 주실 수 있나요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
AI는 필드 이름과 연산자에 대해 KFL 참조를 사용하고, 원하는 트래픽과 일치하는 참이나 거짓 식을 만듭니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
KFL2 — Kubeshark Filter Language
You are a KFL2 expert. KFL2 is built on Google's CEL (Common Expression Language) and is the query language for all Kubeshark traffic analysis. It operates as a display filter — it doesn't affect what's captured, only what you see.
Think of KFL the way you think of SQL for databases or Google search syntax for the web. Kubeshark captures and indexes all cluster traffic; KFL is how you search it.
For the complete variable and field reference, see references/kfl2-reference.md.
Core Syntax
KFL expressions are boolean CEL expressions. An empty filter matches everything.
Operators
| Category | Operators |
|---|---|
| Comparison | ==, !=, <, <=, >, >= |
| Logical | &&, ||, ! |
| Arithmetic | +, -, *, /, % |
| Membership | in |
| Ternary | condition ? true_val : false_val |
String Functions
str.contains(substring) // Substring search
str.startsWith(prefix) // Prefix match
str.endsWith(suffix) // Suffix match
str.matches(regex) // Regex match
size(str) // String length
Collection Functions
size(collection) // List/map/string length
key in map // Key existence
map[key] // Value access
map_get(map, key, default) // Safe access with default
value in list // List membership
Time Functions
timestamp("2026-03-14T22:00:00Z") // Parse ISO timestamp
duration("5m") // Parse duration
now() // Current time (snapshot at filter creation)
Negation
!http // Everything that is NOT HTTP
http && status_code != 200 // HTTP responses that aren't 200
http && !path.contains("/health") // Exclude health checks
!(src.pod.namespace == "kube-system") // Exclude system namespace
Protocol Detection
Boolean flags that indicate which protocol was detected. Use these as the first filter term — they're fast and narrow the search space immediately.
| Flag | Protocol | Flag | Protocol |
|---|---|---|---|
http |
HTTP/1.1, HTTP/2 | redis |
Redis |
dns |
DNS | kafka |
Kafka |
tls |
eBPF TLS interception | amqp |
AMQP |
tcp |
TCP | ldap |
LDAP |
udp |
UDP | ws |
WebSocket |
sctp |
SCTP | gql |
GraphQL (v1+v2) |
icmp |
ICMP | gqlv1 / gqlv2 |
GraphQL version-specific |
grpc |
gRPC (HTTP/2 sub-protocol) | mongodb |
MongoDB |
mysql |
MySQL | postgresql |
PostgreSQL |
radius |
RADIUS | ||
diameter |
Diameter | conn / flow |
L4 connection/flow tracking |
tcp_conn / udp_conn |
Transport-specific connections |
Kubernetes Context
The most common starting point. Filter by where traffic originates or terminates.
Pod and Service Fields
src.pod.name == "orders-594487879c-7ddxf"
dst.pod.namespace == "production"
src.service.name == "api-gateway"
dst.service.namespace == "payments"
Pod fields fall back to service data when pod info is unavailable, so
dst.pod.namespace works even for service-level entries.
Summary Name and Namespace
Convenience variables that pick the best available identity for a peer:
src.name == "api-gateway" // pod > service > dns > process
dst.name.contains("payment") // works across identity types
src.namespace == "production" // pod namespace, falls back to service
dst.namespace != "kube-system" // exclude system namespace
Aggregate Collections
Match against any direction (src or dst):
"production" in namespaces // Any namespace match
"orders" in pods // Any pod name match
"api-gateway" in services // Any service name match
Labels and Annotations
map_get(local_labels, "app", "") == "checkout" // Safe access with default
map_get(remote_labels, "version", "") == "canary"
"tier" in local_labels // Label existence check
Always use map_get() for labels and annotations — direct access like
local_labels["app"] errors if the key doesn't exist.
Node and Process
node_name == "ip-10-0-25-170.ec2.internal"
local_process_name == "nginx"
remote_process_name.contains("postgres")
DNS Resolution
src.dns == "api.example.com"
dst.dns.contains("redis")
HTTP Filtering
자주 묻는 질문
KFL이 Kubeshark가 캡처하는 것을 바꾸나요?
아닙니다. KFL은 표시 필터이므로, 캡처된 트래픽 중 무엇을 볼지만 바꿉니다.
KFL은 다른 언어를 기반으로 하나요?
네. Google의 CEL, 즉 Common Expression Language를 기반으로 합니다.
필터가 왜 실패하나요?
KFL은 정적 타입이므로, 잘못된 필드 이름이나 문법이 오류나 조용한 누락을 일으킬 수 있습니다.
상세 정보
작성자의 원본 설명
KFL2 (Kubeshark Filter Language) reference. This skill MUST be loaded before writing, constructing, or suggesting any KFL filter expression. KFL is statically typed — incorrect field names or syntax will fail silently or error. Do not guess at KFL syntax without this skill loaded. Trigger on any mention of KFL, CEL filters, traffic filtering, display filters, query syntax, filter expressions, write a filter, construct a query, build a KFL, create a filter expression, "how do I filter", "show me only", "find traffic where", protocol-specific queries (HTTP status codes, DNS lookups, Redis comman
repo: kubeshark/kubeshark
인기도
- GitHub 스타
- 12k
- 순위
- #11474
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 11. 1.
댓글
- …
이 저장소의 다른 스킬
install
12k에이전트가 빠른 명령줄 설정부터 전체 Helm 구성까지, Kubernetes 클러스터에 Kubeshark를 설치하도록 돕습니다.
network-rca
12k에이전트가 저장된 트래픽 스냅샷을 분석해 Kubernetes 클러스터에서 지난 네트워크 장애를 조사하도록 돕습니다.
security-audit
12k에이전트가 공격, 데이터 탈취, 악성코드 등 위협의 징후를 찾아 Kubernetes 클러스터 트래픽을 점검하도록 돕습니다.
비슷한 스킬
openclaw-update
394k에이전트가 설치 방식에 맞는 방법을 골라 기존 OpenClaw Gateway를 업데이트하고, 세션이 계속 작동하도록 돕습니다.
diagnose-gateway
394k에이전트가 설정, 채널, 포트를 확인해 OpenClaw Gateway가 왜 실패하는지 찾되, 아무것도 바꾸지 않도록 돕습니다.
crabbox-apps
394k에이전트가 임시 클라우드 머신에서 앱을 열고 실행한 뒤, 그 화면을 채팅의 측면 패널에 보여 주도록 돕습니다.