netflow_raw_search
Search raw NetFlow records (per-flow, not aggregated). Wraps GET /api/netflow/list (permission: vne).
HORIZON — read this before choosing a window: the raw table holds only about 15 MINUTES. cleanup_netflow (pg_cron, every 15 min) rolls flows into agg_netflow and DELETEs every netflow row whose end_time is older than 15 minutes. hours accepts 1-168, but no data older than that horizon exists to match, so a 24-hour request coming back empty is the expected outcome, not a fault. For anything beyond the last few minutes use netflow_search (the aggregated view).
Within the horizon this is the drill-down: when netflow_search shows that 10.0.0.5 sent a lot of bytes to 8.8.8.8, this tool returns the actual flow rows, with the per-flow packet counts, scalar src_port and exact timing that the rollup discards. (vlan and the iface columns survive the rollup — netflow_search filters on those too.)
IP / port filters: src_ip, dst_ip, src_port and dst_port are each STRICT equality on that one column and NEVER match the opposite side. Use the compound ip (src_ip OR dst_ip) or port (src_port OR dst_port) when you don't know which side the host or service was on — reaching for src_ip instead silently drops every flow where the host was the destination. Passing both src_ip and dst_ip ANDs them into a single direction.
Window: hours (1-168, default 24) OR start_time+end_time (ISO-8601 UTC), matched by OVERLAP (start_time < end AND end_time > start) — any flow ACTIVE during the window matches, including flows straddling either edge and live flows whose end_time is padded a little into the future. limit defaults to 50 (max 500). Tag-scoped server-side on the conversation ENDPOINTS — src_ip / dst_ip against the caller's in-tag device IPs, not flow_src.
Example: netflow_raw_search({ip: '10.0.0.5', dst_port: 443, hours: 1})
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ip | No | Compound: matches src_ip OR dst_ip. Prefer this over src_ip/dst_ip whenever the host's side is unknown. | |
| port | No | Compound: matches src_port OR dst_port. Prefer this when the service's side is unknown. | |
| vlan | No | ||
| hours | No | Lookback hours (1-168). Default 24. | |
| limit | No | Max rows (1-500). Default 50. | |
| dst_ip | No | Strict equality on dst_ip alone — never matches a host sitting on the src side. Use `ip` unless you know the direction. | |
| src_ip | No | Strict equality on src_ip alone — never matches a host sitting on the dst side. Use `ip` unless you know the direction. | |
| dst_port | No | Strict equality on dst_port alone. Use `port` unless you know the direction. | |
| end_time | No | ISO-8601 UTC; pairs with start_time. | |
| flow_src | No | IP of the device that exported the flow. | |
| in_iface | No | Ingress SNMP ifIndex as exported by flow_src, e.g. "5". A number, not an interface name and not an interfaces.id. | |
| protocol | No | IP protocol NUMBER, e.g. "6" (TCP), "17" (UDP), "1" (ICMP). The column is a smallint — protocol names are rejected by the database. | |
| src_port | No | Strict equality on src_port alone. Use `port` unless you know the direction. | |
| out_iface | No | Egress SNMP ifIndex, e.g. "7". A number, not an interface name. | |
| start_time | No | ISO-8601 UTC; pairs with end_time. |