You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FlowGrouper groups Unirec flow records that share the same 5-tuple (source IP,
5
+
destination IP, source port, destination port and protocol) within a configurable
6
+
time window and assigns a stable `FLOW_GROUP_KEY` to all records that belong to
7
+
the same group.
8
+
9
+
This module is useful when aggregating flow records that may be
10
+
received multiple times (e.g., from multiple exporters).
11
+
12
+
13
+
## Interfaces
14
+
- Input: 1
15
+
- Output: 1
16
+
17
+
## Required Unirec Fields
18
+
The module expects the input Unirec template to contain the following fields:
19
+
-`SRC_IP` (ipaddr)
20
+
-`DST_IP` (ipaddr)
21
+
-`SRC_PORT` (uint16)
22
+
-`DST_PORT` (uint16)
23
+
-`PROTOCOL` (uint8)
24
+
25
+
FlowGrouper will extend the template by adding `uint64 FLOW_GROUP_KEY` to the output records.
26
+
27
+
## Parameters
28
+
Command-line parameters follow the TRAP / Unirec conventions. The main module
29
+
parameters are:
30
+
31
+
-`-s, --size <int>` Exponent N for the hash map size (2^N entries). Default value is 15
32
+
-`-t, --timeout <int>` Time to consider similar flows as duplicates in milliseconds. Default value is 5000 (5s)
33
+
34
+
-`-m, --appfs-mountpoint <path>` Path where the appFs directory will be mounted
35
+
36
+
### Common TRAP / Unirec parameters
37
+
-`-h` : print help and module-specific parameters
38
+
-`-v`, `-vv`, `-vvv` : verbosity levels
39
+
40
+
## How Flow Grouping Works
41
+
- Records are grouped when they arrive within the configured `--timeout`
42
+
interval and share the same `SRC_IP`, `DST_IP`, `SRC_PORT`, `DST_PORT` and
43
+
`PROTOCOL` values.
44
+
- When a record arrives and no existing group matches, a new `FLOW_GROUP_KEY`
45
+
is created and stored in an internal timeout hash map keyed by the 5-tuple.
46
+
- Subsequent records that match the tuple within the timeout receive the same`FLOW_GROUP_KEY`.
47
+
Note: FLOW_GROUP_KEY is not unique identifier. It identifies records that belong to the same group only in the context of the 5-tuple (SRC_IP, DST_IP, SRC_PORT, DST_PORT, PROTOCOL).
48
+
## Telemetry data format
49
+
50
+
```
51
+
├─ input/
52
+
│ └─ stats
53
+
└─ flowGrouper/
54
+
└─ statistics
55
+
```
56
+
57
+
Telemetry counters include:
58
+
-**Inserted groups:** number of newly created flow groups
59
+
-**Replaced groups:** number of times an existing bucket entry was replaced with new group
60
+
-**Found groups:** number of times a matching group was found for an input record
61
+
62
+
63
+
## Usage Examples
64
+
Process Unirec records from a TRAP input and forward them with an added
65
+
`FLOW_GROUP_KEY`. The example sets the hash map exponent to `15` (2^15 entries)
0 commit comments