NetCaptureJob CR
NetCaptureJob CR allows you to define how traffic should be captured from VPP-based components across Core Clusters. It lets you configure all key aspects of a capture job, including source selection, filtering, batching, destination settings, and rotation policies.
The following sections describe all configurable parameters available in the NetCaptureJob CR. For a step-by-step guide on how to perform the configuration, see the Configure PCAP capturing guide.
Traffic capture time schedule
You can configure traffic capturing to run either once at a specific time or on a recurring schedule.
One-time traffic capturing
You can define when a traffic capturing should start and end using the spec.forProvider.schedule.start and spec.forProvider.schedule.end fields in the NetCaptureJob resource. The following formats are supported:
- Duration:
10m,1h30m - Time of day:
14:00,14:20:00,now - Full date and time:
2025-12-16 06:20:00
If not specified, the traffic stream is collected as long as the NetCaptureJob resource exists.
See the configuration example:
All time periods are provided in UTC. To specify a local time, include a time zone offset. For example: 2026-06-27 16:28:13 +0200 (for CEST). This will be interpreted and shown in the job status as: scheduledStart: "2026-06-27T14:28:13Z".
Periodic traffic capturing
You can configure a periodic traffic capturing by providing the cron expression and the duration in the spec.forProvider.schedule.periodic.schedule and spec.forProvider.schedule.periodic.duration fields in the NetCaptureJob resource.
Cron expression can be in formats:
schedule: "30 * * * *"– Uses standard cron syntax to schedule captures based on clock time (for example, at the 30th minute of every hour).schedule: "@every 1h30m"– Schedules captures at a fixed interval after traffic capturing starts (for example, every 1 hour and 30 minutes).schedule: @hourly– Schedules captures at regular intervals based on the clock time, not the traffic capturing start time. Supported values:@hourly,@daily,@weekly,@monthly,@yearly.
For all supported formats, refer to the Cronv3 Golang library documentationOpens in a new tab.
Duration can be in formats:
duration: 10– Traffic capture lasts for a specified number of seconds after traffic capturing starts (for example,10means every 10 seconds).duration: 10s– Traffic capture lasts for a specified duration (s, m, h) after traffic capturing starts, for example:10s,10.5m,10h10m.
See the configuration example:
Sources of traffic capturing
To configure where traffic should be captured, you must specify the target Core Cluster using the spec.forProvider.streamTemplate.spec.cluster field. This is a required setting that determines the cluster in which the traffic stream will be captured. Each NetCaptureJob can target only one Core Cluster.
Within that cluster, you can narrow down which VPP-based pods should perform the capture by using the spec.forProvider.streamTemplate.spec.selector field. This selector allows you to limit the capture scope to a specific VPP pod and namespace, ensuring fine-grained control over PCAP collection.
See the configuration example:
The spec.forProvider.streamTemplate.spec.sources section lists the traffic sources to be captured. NetCap supports these two sources of traffic capturing:
- Interface
- IMSI
Interface
To capture traffic based on an interface, specify the spec.forProvider.streamTemplate.spec.sources[].interface key in the NetCaptureJob CR. For example:
The interface.name must match the VPPInterface.spec.ifName. To get the interface name, run this command in the FPP pod:
On a UPG pod, use:
You can also query the Kubernetes API server from a Core Cluster using kubeclt:
Sample the output example:
In the output, the text before the colon (:) is the pod name, and the text after it is the interface name.
IMSI
To capture traffic based on IMSI, specify the spec.forProvider.streamTemplate.spec.sources[].imsi key in the NetCaptureJob CR. For example:
Note
Capturing traffic based on IMSI is only possible for the UPG pods.
NATS messaging modes
The spec.forProvider.streamTemplate.spec.sources[].{imsi|interface}.natsMode parameter defines how traffic is sent and received over Cennso Data Mesh (CDM). Two messaging modes are available:
- pubsub – Use this mode for non-critical or low-priority traffic. In this mode, NATS delivers messages in real time but does not store them, so data can be lost if the consumer is temporarily unavailable. It’s best suited for short-lived streams or monitoring scenarios where occasional loss is acceptable.
- jetstream (default) – Use this mode when you need reliable delivery and message persistence. JetStream stores messages and supports replay, making it ideal for long-term captures, high-value traffic, or scenarios where reliability and fault tolerance are important.
See the configuration example:
Traffic filtering
When collecting traffic from a given interface, you can specify the spec.forProvider.streamTemplate.spec.sources[].interface.filter parameter that lets you specify a filter expression compatible with the standard tcpdump syntaxOpens in a new tab to capture only specific types of packets. Applying a filter helps you reduce the amount of captured traffic and ensures only relevant packets are collected.
For example, you can apply such a filter:
In this example, only ARP or ICMP traffic will be captured from the sgi interface.
Packet batching strategy
The spec.forProvider.streamTemplate.spec.sources[].{imsi|interface}.batchingStrategy field controls how packets are grouped before sending them to the destination. You can define batching behaviour using three optional parameters:
- packetsCount - sets the number of packets to accumulate before sending a batch (default is
10). Higher values may improve throughput at the cost of latency. - duration - specifies the maximum time interval to wait before sending a batch (default is
3seconds) - packetsBytes - allows batching based on the total number of bytes collected
See the configuration example:
Match labels
The spec.forProvider.streamTemplate.spec.sources[].{imsi|interface}.match-labels section defines label-based criteria for selecting FPP or UPG instances from which traffic should be captured. These labels are matched against environment variables set on the target pods. Only instances with environment variables that match all specified key-value pairs will be selected.
For example:
In this case, only FPP or UPG pods with both NETCAP_APN="test.cennso.com" and NETCAP_LANE="lane-b" environment variables will be included in the traffic capture.
PCAP file rotation schedule
To prevent PCAP files from growing indefinitely and consuming too much storage or becoming difficult to process, NetCap supports a PCAP file rotation schedule using cron expressions. PCAP file rotation is disabled by default. To enable it, set the spec.forProvider.destinationTemplate.spec.destinations.fileParams.rotate parameter to true. Then, configure rotation schedule using the spec.forProvider.destinationTemplate.spec.destinations.fileParams.schedule field, which accepts several formats:
schedule: 10– Rotates every specified number of seconds after traffic capturing starts (for example,10means every 10 seconds).schedule: 10s– Rotates at a specified interval after traffic capturing starts, using time units (s, m, h), for example:10s,10.5m,10h10m.schedule: "@every 1h30m"– Rotates at a fixed interval after traffic capturing starts (for example, every 1 hour and 30 minutes).schedule: @hourly– Rotates at regular intervals based on the clock time, not the traffic capturing start time. Supported values:@hourly,@daily,@weekly,@monthly,@yearly.schedule: "30 * * * *"– Uses standard cron syntax to rotate based on clock time (for example, at the 30th minute of every hour).
For all supported formats, refer to the Cronv3 Golang library documentationOpens in a new tab.
See the configuration example:
In this example, PCAP file rotation is enabled and configured to rotate files at the beginning of every hour.
Date directories for rotated PCAP files
A capture with a short rotation schedule writes every PCAP file into one directory. That directory becomes slow to browse and list. NetCap can group those files into subdirectories named after the rotation time in UTC. Set the spec.forProvider.destinationTemplate.spec.destinations.fileParams.dateDirectories parameter to one of these values:
none– Writes every file directly into the destination directory. This is the default.monthly– Adds one directory per month, for example2026-09/.daily– Adds one directory per day, for example2026-09-15/.hourly– Adds one directory per day and one per hour, for example2026-09-15/19/.
NetCap adds these directories inside the path or prefix that the destination already uses.
See the configuration example:
In this example, NetCap writes a file rotated at 2026-09-15T19:30:00Z to the 2026-09-15/ directory.
Cleanup of empty date directories depends on the storage type:
- Local storage – NetCap removes an empty date directory. A directory becomes empty when NetCap deletes its last file under the max_files limit.
- S3 storage – The date is part of the object key, so there is no directory to remove.
- SFTP storage – Empty date directories stay on the server.
PCAP file compression
NetCap supports the following compression formats for PCAP files: zstd, lz4, gzip, and none (no compression). To configure the format, set the spec.forProvider.destinationTemplate.spec.destinations.fileParams.compress parameter to one of these values.
You can fine-tune the compression level using the spec.forProvider.destinationTemplate.spec.destinations.fileParams.compressLevel parameter. This is an integer value, where higher values increase compression at the cost of speed:
gzip: values from 1 (fastest) to 9 (best compression but slowest), default 6zstd: values from 1 (fastest) to 20 (best compression but slowest), default 5lz4: values from 1 (fastest) to 9 (best compression but slowest), default 1
See the configuration example:
Status
NetCap Provider updates the traffic stream status in the NetCaptureJob custom resource (CR). This status information is gathered through Cennso Data Mesh (CDM) from multiple NetCap components, including the NetCap Sink, NetCap Collector, Fast Path Provider (FPP), and User Plane Gateway (UPG).
The following statuses provide insights into the state and health of the traffic capturing, including:
StreamCreated- informs that the stream was successfully created by all componentsPacketSent- informs that packets were sent from NetCap CollectorPacketReceived- informs that packets were received by the NetCap SinkStreamCollecting- informs that NetCap VPP Plugin configured traffic capturing in the VPP instanceStreamCreateError,PacketReceiveError,PacketSendError- inform about errors encountered during stream or destination creation (most commonly due to misconfiguration)
Under the hood, the created resources are validated, and the following checks are executed:
- Validate that multiple storages are not provided.
- Validate that both one-time and periodic schedules are not provided.
- Validate that captures with both IMSI and interface parameters are not provided.
If one of these checks fails, the resource is not processed further, and the Synced: false status is set.
To learn how to get the NetCaptureJob status, See the NetCaptureJob status section.