nxtflow is an open-source NetFlow v5/v9, IPFIX, and sFlow observability and AI-analysis platform for Docker Compose and Kubernetes. It pairs upstream netsampler/goflow2 with a lightweight Python enricher (nxtflow-enricher), pluggable storage backends (VictoriaLogs default, Grafana Loki, or ClickHouse), an interactive Web UI (nxtflow-ui), a multi-panel Grafana dashboard with click-to-drill-down Host & Flow Deep-Dive, a terminal CLI (nxtflow), and a read-only FastMCP server (nxtflow-mcp) so both engineers and AI coding assistants can query network traffic history in seconds.
- Dynamic Host Exclusion (
?exclude=<host>): Click any⊘Hide button on a host or talker row to filter noisy hosts out of Overview KPIs, Sankey diagrams, and Flow Explorer, with an Exclude chip bar to restore individual hosts or clear all. - Light / Dark Theme Toggle (
☀️/🌙) & Version Badge: Switch between dark and light themes from the top bar (persisted inlocalStorage), with the active release version badge (e.g.,v0.2.4, matchingnxtflow --version) displayed in the header.
flowchart LR
Exporters["Routers & Switches<br/>NetFlow v5/v9 · IPFIX · sFlow<br/>UDP :2055 / :6343"] --> GoFlow2["netsampler/goflow2 v2.2.7<br/>-transport=file (raw.jsonl)"]
GoFlow2 --> Enricher["nxtflow-enricher<br/>Direction · Sampling · rDNS · NetBox<br/>:8081 HTTP/Health · :9090 Metrics"]
Enricher -->|Direct gzip push or Alloy sidecar| Store["Storage Backend<br/>VictoriaLogs (default) · Loki · ClickHouse"]
Enricher --> Prom["Prometheus<br/>ServiceMonitor & PrometheusRule"]
Store --> UI["nxtflow-ui<br/>Interactive Web Explorer & Host Drawer"]
Store --> Grafana["Grafana Dashboard<br/>Sankey · dataLinks · Host & Flow Deep-Dive"]
Store --> CLI["nxtflow CLI"]
Store --> MCP["nxtflow-mcp<br/>10 read-only FastMCP tools"]
nxtflow defaults to VictoriaLogs (NXTFLOW_BACKEND=victorialogs) for high-cardinality speed, zero series caps, and a tiny single-binary footprint, while natively supporting Grafana Loki and ClickHouse across nxtflow-enricher, nxtflow CLI, nxtflow-mcp, nxtflow-ui, Docker Compose, and the Helm chart:
| Metric | VictoriaLogs (Default) | Grafana Loki | ClickHouse |
|---|---|---|---|
Interactive Queries (5m–24h) |
76ms–185ms | 300ms–2s+ | 10ms–60ms |
Long-Range Queries (7d–30d) |
150ms–1.5s | 5s–30s+ | 10ms–80ms (30d+ OLAP) |
| Memory Footprint (RAM) | ~200–350 MiB | 1–2 GiB | 1–4 GiB |
| Architecture | Single binary | Multi-component (or SingleBinary TSDB) | Columnar MergeTree server |
| Cardinality / Series Cap | Zero 5,000-series cap (native per-IP/port indexing) |
5,000-series cap (max_query_series: 5000) |
Zero series cap (columnar MergeTree) |
| Query Language | LogsQL (_time:... | stats ...) |
LogQL ({job, site, dir}) |
SQL (MergeTree nxtflow.flows) |
| Default Port / Image | :9428 (victoriametrics/victoria-logs:v1.24.0-victorialogs) |
:3100 (grafana/loki:3.7.11) |
:8123 (clickhouse/clickhouse-server:26.8-alpine) |
| Grafana Datasource | victoriametrics-logs-datasource |
Built-in loki |
grafana-clickhouse-datasource |
| Docker Compose Start | ./scripts/up.sh |
./scripts/up.sh --backend loki |
./scripts/up.sh --backend clickhouse |
| Helm Values Example | examples/values-standalone.yaml |
examples/values-loki.yaml |
examples/values-clickhouse.yaml |
| Best For | Default for single-host, K8s & high-cardinality flows | Existing Grafana/Loki stacks | 30d+ OLAP & multi-terabyte SQL analytics |
- Dual-Mode Helm Chart (
charts/nxtflow):- Standalone (
tags.standalone=true): Batteries-included install deploying VictoriaLogs (StatefulSet, default) — or optional Loki / ClickHouse — alongside minimalprometheus,grafana(auto-provisioned datasources + 18-panel dashboard),goflow2+nxtflow-enricher, andnxtflow-mcp. - Integrated (
tags.standalone=false): Plugs into your existing VictoriaLogs, Loki, or ClickHouse,kube-prometheus-stack(ServiceMonitor+PrometheusRule), and Grafana sidecar (grafana_dashboard: "1"). - Collector-Only (
examples/values-collector-only.yaml): Lightweight edge collector shipping flows from remote sites into a central VictoriaLogs, Loki, or ClickHouse instance.
- Standalone (
- 5000-Series-Safe Loki Schema: Writes only 3 bounded stream labels per site (
{job, site, dir}) and protects port aggregations withdst_port =~ '.{1,4}' | __error__=''. - 5-Tuple Pre-NAT Reverse-Correlation (
enricher.classification.natCorrelation): Automatically correlates pre-NAT inbound router WAN flows (external-cdn -> wan-gateway) back to the originating internal host (external-cdn -> (via wan-gateway) -> internal-host) using a bounded TTL 5-tuple lookup table (ttlSeconds: 600,maxEntries: 100000) plus optional GoFlow2post_nat_dst_addrfields. - Interactive Web UI (
nxtflow-ui) & Grafana Drill-Down: Kentik/Netdata-style Starlette + ECharts web explorer (docker compose --profile ui up -dor Helmui.enabled=true) featuring live direction/site/pair Flow Explorer, Host Deep-Dive drawer (observed IPs withipinfo.iolookup, 3-tier Host Traffic Flow Sankey, and 5-tuple sessions), and Host Directory — alongside Grafana click-to-drill-downdataLinkstargeting theHost & Flow Deep-Divepanel. - 7-Tier Host Resolution: Combines
staticHosts, custominternalCidrs,wanIps, optional NetBox IPAM sync, built-in public CDN/DNS CIDRs (103IPv4/IPv6 ranges), and a bounded LRU+TTL reverse DNS cache. - AI-Native Telemetry (
nxtflowCLI &nxtflow-mcp): Query top talkers, top destinations, 5-tuple host sessions, ports, and flow search via terminal or any MCP client (stdioorstreamable-http).
Run the full standalone stack (GoFlow2 + nxtflow-enricher + VictoriaLogs (default)/Loki/ClickHouse + Prometheus + Grafana + nxtflow-mcp) locally or on any Docker host in three commands:
cp .env.example .env
# Edit .env if needed (e.g. NXTFLOW_GRAFANA_PORT=3030 if port 3000 is already in use)
./scripts/up.shOr select a backend (victorialogs default, loki, or clickhouse) with the synthetic NetFlow v9 traffic generator (--demo) and verify end-to-end:
./scripts/up.sh --demo # VictoriaLogs (default)
./scripts/up.sh --backend loki --demo # Grafana Loki
./scripts/up.sh --backend clickhouse --demo # ClickHouse
./scripts/verify-stack.sh # or: --backend loki | clickhouseOnce running:
- Grafana Dashboard:
http://localhost:${NXTFLOW_GRAFANA_PORT:-3000}/d/nxtflow-overview(default login:admin/nxtflow) - Interactive Web UI (
nxtflow-ui, optional--profile ui):http://localhost:${NXTFLOW_UI_PORT:-8082}(docker compose --profile ui up -d nxtflow-ui) - Backend API: VictoriaLogs
http://localhost:${NXTFLOW_VICTORIALOGS_PORT:-9428}(default) · Lokihttp://localhost:${NXTFLOW_LOKI_PORT:-3100}· ClickHousehttp://localhost:${NXTFLOW_CLICKHOUSE_PORT:-8123} - Prometheus UI:
http://localhost:${NXTFLOW_PROMETHEUS_PORT:-9091} - MCP Endpoint:
http://localhost:${NXTFLOW_MCP_PORT:-8000}/mcp - Send a one-shot test burst:
python3 scripts/demo-flows.py --once - Query via containerized CLI (no local Python install required):
docker compose exec nxtflow-mcp nxtflow summary --range 15m
Customize docker/enricher/enricher.yaml to add wanIps, staticHosts, or internalCidrs, and docker compose up -d --force-recreate enricher to apply.
-> Full Docker Compose Guide: docs/docker-compose.md · nertwork.github.io/nxtflow/docker-compose.html
Deploys the collector, enricher, VictoriaLogs, Prometheus, Grafana, and MCP server in one release:
helm install nxtflow oci://ghcr.io/nertwork/charts/nxtflow \
--namespace nxtflow --create-namespace \
-f examples/values-standalone.yamlForward Grafana locally and open http://localhost:3000/d/nxtflow-overview:
kubectl port-forward -n nxtflow svc/nxtflow-grafana 3000:80Connects to an existing VictoriaLogs (default), Loki, or ClickHouse endpoint and provisions ServiceMonitor, PrometheusRule, and the Grafana dashboard ConfigMap:
helm install nxtflow oci://ghcr.io/nertwork/charts/nxtflow \
--namespace monitoring \
-f examples/values-integrated.yaml \
--set externalVictoriaLogs.url="https://victorialogs.example.com"Deploys only the UDP collector and enricher for a remote branch site:
helm install nxtflow-edge oci://ghcr.io/nertwork/charts/nxtflow \
--namespace nxtflow \
-f examples/values-collector-only.yaml \
--set collector.site="branch-west" \
--set externalVictoriaLogs.url="https://victorialogs.example.com"Note on
externalTrafficPolicy: Local: Keepcollector.service.externalTrafficPolicy=LocalonLoadBalancer/NodePortservices so Kubernetes preserves the true source IP of your exporting routers instead of SNATing it.
Every enriched flow record is tagged with bounded Loki stream labels {job, site, dir} so you can aggregate and filter multi-site traffic without cardinality explosion:
- Site Label (
collector.site): Set a uniquecollector.site(for example"us-east","branch-west", or"lab") on each Helm release. New sites automatically appear in the GrafanaSitedropdown andnxtflow status. - Direction Classification & Pre-NAT Correlation (
enricher.classification): ConfigurelocalCidrs(your internal subnets) andwanIps(your router public/WAN IPs for that site) so traffic is accurately tagged asup,down, orlan, and keepnatCorrelation.enabled=trueso pre-NAT inbound WAN downloads resolve back to the internal LAN host. - Host & Service Aliases (
enricher.resolution): Map key IPs instaticHosts(such as"192.168.1.1": "core-router"), name internal subnets ininternalCidrs, or enableenricher.netbox.enabled=trueto sync IPAM hostnames automatically.
The nxtflow CLI and nxtflow-mcp resolve settings in order: built-in defaults -> ~/.config/nxtflow/config.yaml (or --config / NXTFLOW_CONFIG_FILE) -> environment variables:
| Environment Variable | Default | Description |
|---|---|---|
NXTFLOW_BACKEND |
victorialogs |
Active storage backend (victorialogs, loki, or clickhouse) |
NXTFLOW_LOKI_URL |
http://localhost:3100 |
Base URL for the target Loki API |
NXTFLOW_VICTORIALOGS_URL |
http://localhost:9428 |
Base URL for VictoriaLogs (/insert/jsonline, /select/logsql/*) |
NXTFLOW_VICTORIALOGS_ACCOUNT_ID / NXTFLOW_VICTORIALOGS_PROJECT_ID |
"" |
Optional VictoriaLogs multitenancy headers (AccountID, ProjectID) |
NXTFLOW_CLICKHOUSE_URL |
http://localhost:8123 |
Base HTTP URL for ClickHouse |
NXTFLOW_CLICKHOUSE_DATABASE / NXTFLOW_CLICKHOUSE_TABLE |
nxtflow / flows |
ClickHouse database and MergeTree table name |
NXTFLOW_CLICKHOUSE_USER / NXTFLOW_CLICKHOUSE_PASSWORD |
default / "" |
ClickHouse credentials (nxtflow in local Docker Compose) |
NXTFLOW_JOB |
nxtflow |
job label to query (collector.job) |
NXTFLOW_TLS_VERIFY |
true |
true, false, or path to a custom CA bundle |
NXTFLOW_LOKI_TOKEN |
"" |
Optional Bearer token for authenticated Loki |
NXTFLOW_LOKI_USER / NXTFLOW_LOKI_PASSWORD |
"" |
Optional Basic auth credentials for Loki |
NXTFLOW_LOKI_TENANT_ID |
"" |
Optional X-Scope-OrgID multi-tenant header |
NXTFLOW_EXCLUDED_HOSTS |
multicast,link-local |
Comma-separated hostnames excluded from top-N views |
See CLI, MCP Server & AI Skill Integration and charts/nxtflow/values.yaml for the complete reference.
Install the Python package locally (with MCP server support):
pip install "nxtflow[mcp] @ git+https://github.com/nertwork/nxtflow.git"
# or with uv:
uv tool install --from "git+https://github.com/nertwork/nxtflow.git" "nxtflow[mcp]"Query VictoriaLogs (default) from your terminal:
export NXTFLOW_VICTORIALOGS_URL="http://localhost:9428"
nxtflow --version
nxtflow status
nxtflow summary --range 1h
nxtflow top-talkers 10 --range 15m
nxtflow host 192.168.1.10 --range 1h
nxtflow sessions 192.168.1.10Run nxtflow-mcp over stdio (see mcp/nxtflow.mcp.json and skills/nxtflow/SKILL.md):
nxtflow-mcp --transport stdioReady-to-use templates live in examples/exporters/:
- MikroTik RouterOS v7
- Linux
softflowd - pfSense & OPNsense
- Cisco IOS-XE (Flexible NetFlow)
- UniFi Gateway
Run the local audit, linter, Helm checks, and unit test suite before opening a pull request:
docker compose --env-file .env.example config -q
python3 scripts/security_audit.py
ruff check src tests scripts .github/scripts
helm lint charts/nxtflow
pytest -vEvery push and pull request runs automated GitHub Actions verification:
- Lint, Syntax & Security Audit:
scripts/security_audit.pyscans repository files for exposed API tokens, private keys, webhook URLs, and Python/JSON syntax issues. - Python Lint & Unit Tests:
ruffstatic checks andpytestcoverage across CLI, enricher, and MCP tools. - Helm Lint, Schema & Template:
helm lint, JSON Schema validation (values.schema.json),ct lint, and multi-mode template rendering tests. - Docker Build & Kind Helm Install: Builds container images and executes an end-to-end
helm install+helm testinside an ephemeral Kind cluster. - CodeQL, Dependabot & Supply-Chain Security: Continuous GitHub CodeQL static analysis (
codeql.ymlfor Python and GitHub Actions), Dependabot vulnerability & malware alerts, Secret Scanning + Push Protection, and Private Vulnerability Reporting.
See SECURITY.md for architecture details and private vulnerability reporting.
Full hosted documentation is automatically published to https://nertwork.github.io/nxtflow/:
- Documentation Home
- Docker Compose Deployment Guide
- System Architecture
- Standalone vs. Integrated Deployment
- Helm Chart Reference
- Exporter Guides & Tuning
- CLI, MCP Server & AI Skill Integration
- Changelog & Contributing Guide
Thank you to everyone contributing code, exporter guides, bug reports, and platform improvements to nxtflow!
- @nertwork (James Farr Gomez) — Creator & Maintainer (Helm chart architecture,
nxtflow-enricher, multi-backend flow pipeline (VictoriaLogs, Loki, ClickHouse), 18-panel Grafana dashboard,nxtflowCLI & FastMCP server).
See the full GitHub Contributors Graph and our Contributing Guide to get involved.
Contributions are welcome! Please review CONTRIBUTING.md before submitting a pull request. Released under the MIT License.






