kfl
Skill này làm gì
Skill dạy AI cú pháp và các trường của KFL, một ngôn ngữ lọc để tìm lưu lượng trong Kubeshark. Skill dành cho kỹ sư tìm kiếm lưu lượng trong cụm.
Khi nào nên dùng
- ✓Khi bạn muốn lọc lưu lượng Kubeshark theo giao thức, cổng hoặc trường.
- ✓Khi bạn cần một biểu thức KFL khớp với một số request hoặc response nhất định.
- ✓Khi một bộ lọc KFL báo lỗi và cần sửa.
Liên kết skill
https://github.com/kubeshark/kubeshark/blob/master/skills/kfl/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Bạn có thể viết một bộ lọc Kubeshark chỉ hiển thị các request HTTP tới cổng 8080 không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
AI dùng tài liệu tham khảo KFL để lấy tên trường và toán tử, rồi xây một biểu thức đúng hoặc sai khớp với lưu lượng bạn muốn.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
Câu hỏi thường gặp
KFL có thay đổi những gì Kubeshark thu thập không?
Không. Nó là bộ lọc hiển thị, nên chỉ thay đổi lưu lượng đã thu thập nào bạn xem.
KFL có dựa trên ngôn ngữ khác không?
Có, nó được xây trên CEL, Common Expression Language của Google.
Vì sao bộ lọc của tôi thất bại?
KFL có kiểu tĩnh, nên tên trường sai hoặc cú pháp sai có thể gây lỗi hoặc bỏ sót âm thầm.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 12k
- Vị trí xếp hạng
- #11474
- Giấy phép
- Apache-2.0
- Cập nhật
- 1/11/2026
Bình luận
- …
Thêm skill từ kho mã này
install
12kGiúp agent của bạn cài Kubeshark trên cụm Kubernetes, từ thiết lập CLI nhanh đến cấu hình Helm đầy đủ.
network-rca
12kGiúp agent của bạn điều tra một sự cố mạng đã xảy ra trong cụm Kubernetes bằng cách nghiên cứu các snapshot lưu lượng đã lưu.
security-audit
12kGiúp agent của bạn kiểm tra lưu lượng cụm Kubernetes để tìm dấu hiệu tấn công, đánh cắp dữ liệu, mã độc và các mối đe dọa khác.
Skill tương tự
openclaw-update
394kGiúp agent của bạn cập nhật OpenClaw Gateway đang có, chọn cách cập nhật phù hợp với cách cài đặt và giữ phiên làm việc của bạn hoạt động.
diagnose-gateway
394kGiúp agent của bạn tìm hiểu vì sao OpenClaw Gateway bị lỗi bằng cách kiểm tra cài đặt, kênh và cổng mà không thay đổi gì.
crabbox-apps
394kGiúp agent của bạn mở và chạy một app trên máy đám mây tạm thời, rồi hiển thị giao diện của nó trong thanh bên của chat.