FLOW-CAPTURE(1)

πŸ“¦ version 0.68.5.1, in fedora 43, fedora 44

πŸ¦‹ FLOW-CAPTURE(1) πŸ¦‹

okay bestie, sit down, hydrate, because we're about to talk about flow-capture β€” the flow-tools manual page, section 1 (general commands, iykyk). it's giving network admin main character energy and honestly? iconic. πŸ’…


✨ NAME ✨

flow-capture β€” manage storage of flow file archives by expiring old data.

πŸŽ€ SYNOPSIS πŸŽ€

flow-capture [ -hu ]  [ -b big|little ]  [ -C comment ]  [ -c
flow_clients ]  [ -d debug_level ]  [ -D daemonize ]  [ -e expire_count
]  [ -f filter_fname ]  [ -F filter_definition ]  [ -E expire_size ]  [
-n rotations ]  [ -N nesting_level ]  [ -p pidfile ]  [ -R
rotate_program ]  [ -S stat_interval ]  [ -t tag_fname ]  [ -T
active_def|active_def,active_def... ]  [ -V pdu_version ]  [ -z z_level
]  -w workdir [ -x xlate_fname ]  [ -X xlate_definition ]
localip/remoteip/port

like, yes, that's a lot of brackets. breathe. we'll get through them together 🫢

πŸ’– DESCRIPTION πŸ’–

the flow-capture utility will receive and store NetFlow exports to disk. the flow files get rotated rotations times per day, and expiration of old flow files can be configured by number of files or total space utilization. files are stored in workdir and can optionally be stored in additional levels of directories. active files created by flow-capture begin with tmp. files that are complete begin with ft. slay, consistent naming conventions, we love to see it ✨

when the remoteip is configured, only flows from that exporter will be processed β€” this is the most secure and recommended configuration, no cap. when the localip is configured, flow-capture will only process flows sent to the localip IP address. if remoteip is 0 (not configured) flows from any source IP address are accepted. multiple non aggregated PDU versions may be accepted at once to support Cisco's Catalyst 6500 NetFlow implementation, which exports from both the supervisor and MSFC with the same IP address and same port but different export versions. in this case the exports will be stored in the format specified by pdu_version, or whichever export type is received first. first come first served, literally 😭

NetFlow exports are UDP and do not employ congestion control or a retransmission mechanism. if the server flow-capture is configured on is too busy, or the network is congested or lossy, NetFlow exports will be lost. an estimate of lost flows is recorded in the flow files, and logged via syslog. most servers will provide a count of dropped packets due to full socket buffers via the netstat utility. for example netstat -s | grep full will provide a count of UDP packets dropped due to full socket buffers. if this is a persistent occurrence, either flow-capture will need a larger server or the compression level should be decreased with -z. πŸ’€

a SIGHUP signal will cause flow-capture to close the current file and create a new one. fresh start, new me, etc 🌸

a SIGQUIT or SIGTERM signal will cause flow-capture to close the current file and exit. bye bestie πŸ‘‹


πŸ’… OPTIONS πŸ’…

  • -b big|little β€” byte order of output.
  • -c flow_clients β€” enable flow_clients TCP clients. when libwrap is available the client must be in a permit list for the service flow-capture-client.
  • -C Comment β€” add a comment.
  • -d debug_level β€” enable debugging.
  • -e expire_count β€” retain the maximum number of files so that the total file count is less than expire_count. defaults to 0 (do not expire).
  • -E expire_size β€” retain the maximum number of files so that the total storage is less than expire_size. the letters b, K, M, G can be used as multipliers, ie 16 Megabytes is 16M. default to 0 (do not expire).
  • -f filter_fname β€” filter list filename. defaults to /etc/flow-tools/cfg/filter.
  • -F filter_definition β€” select the active definition. defaults to default.
  • -h β€” display help.
  • -n rotations β€” configure the number of times flow-capture will create a new file per day. the default is 95, or every 15 minutes.
  • -N nesting_level β€” configure the nesting level for storing flow files. the default is 0.
    • -3 YYYY/YYYY-MM/YYYY-MM-DD/flow-file
    • -2 YYYY-MM/YYYY-MM-DD/flow-file
    • -1 YYYY-MM-DD/flow-file
    • 0 flow-file
    • 1 YYYY/flow-file
    • 2 YYYY/YYYY-MM/flow-file
    • 3 YYYY/YYYY-MM/YYYY-MM-DD/flow-file
  • -p pidfile β€” configure the process ID file. use - to disable pid file creation.
  • -R rotate_program β€” execute rotate_program with the first argument as the flow file name after rotating it.
  • -S stat_interval β€” when configured, flow-capture will log a timestamped message every stat_interval minutes indicating counters such as the number of flows received, packets processed, and lost flows.
  • -t tag_fname β€” load tags from tag_name
  • -T active_def|active_def,active_def... β€” use active_def as the active tag definition(s).
  • -u β€” preserve inherited umask. by default the umask will be set to 0022.
  • -V pdu_version β€” use pdu_version format output.
    • 1 β€” NetFlow version 1 (No sequence numbers, AS, or mask)
    • 5 β€” NetFlow version 5
    • 6 β€” NetFlow version 6 (5+ Encapsulation size)
    • 7 β€” NetFlow version 7 (Catalyst switches)
    • 8.1 β€” NetFlow AS Aggregation
    • 8.2 β€” NetFlow Proto Port Aggregation
    • 8.3 β€” NetFlow Source Prefix Aggregation
    • 8.4 β€” NetFlow Destination Prefix Aggregation
    • 8.5 β€” NetFlow Prefix Aggregation
    • 8.6 β€” NetFlow Destination (Catalyst switches)
    • 8.7 β€” NetFlow Source Destination (Catalyst switches)
    • 8.8 β€” NetFlow Full Flow (Catalyst switches)
    • 8.9 β€” NetFlow ToS AS Aggregation
    • 8.10 β€” NetFlow ToS Proto Port Aggregation
    • 8.11 β€” NetFlow ToS Source Prefix Aggregation
    • 8.12 β€” NetFlow ToS Destination Prefix Aggregation
    • 8.13 β€” NetFlow ToS Prefix Aggregation
    • 8.14 β€” NetFlow ToS Prefix Port Aggregation
    • 1005 β€” Flow-Tools tagged version 5
  • -w workdir β€” work in workdir.
  • -x xlate_fname β€” translation config file name. defaults to /etc/flow-tools/cfg/xlate.cfg
  • -X xlate_definition β€” translation definition. defaults to default.
  • -z z_level β€” configure compression level to z_level. 0 is disabled (no compression), 9 is highest compression.

🌈 EXAMPLES 🌈

okay so scenario one: receive flows from the exporter at 10.0.0.1 port 9800. maintain 5 Gigabytes of flow files in /flows/krc4. mask the source and destination IP addresses contained in the flow exports with 255.255.248.0. πŸŽ€

flow-capture -w /flows/krc4 -m 255.255.248.0 -E5G 0/10.0.0.1/9800

scenario two, the chaotic one: receive flows from any exporter on port 9800. do not perform any flow file space management. store the exports in /flows/krc4. emit a stat log message every 5 minutes. lowkey unhinged but it's valid πŸ’œ

flow-capture -w /flows/krc4 0/0/9800 -S5

πŸ™ˆ BUGS πŸ™ˆ

empty directories are not removed. not me noticing the empty directories just vibing there forever πŸ’€

πŸ“ FILES πŸ“

configuration files: Tag β€” /etc/flow-tools/cfg/tag.cfg. Filter β€” /etc/flow-tools/cfg/filter.cfg. Xlate β€” /etc/flow-tools/cfg/xlate.cfg.

πŸ‘‘ AUTHOR πŸ‘‘

Mark Fullmer <maf@splintered.net> β€” the icon, the moment, the legend 🫢

⭐ SEE ALSO ⭐

flow-tools(1)


and that's the whole page bestie, no notes, ate and left no crumbs ✨ this was FLOW-CAPTURE(1), dated 26 Август 2010, and that's the flow-tools flex πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from