FLOW-REPORT(1)
β¨ NAME β¨
flow-report β Generate reports from flow data.
Okay bestie, welcome to the FLOW-REPORT(1) page. This is the manual for flow-report, and it's about to be your new obsession. πβ¨
π οΈ SYNOPSIS π οΈ
flow-report [ -h ] [ -d debug_level ] [ -s stat_fname ] [ -S stat_definition ] [ -v variable binding ]
π DESCRIPTION π
The flow-report utility will generate reports from flow data. The reports are easy to parse ASCII text that can be used by a front end to produce readable reports, graphs, and charts. Slay. π
Reports are defined in a configuration file by the stat-report keyword followed by a report name. Each report has a type defined below and other commands. Reports are grouped into a definition with the stat-definition keyword followed by a definition name. Each definition can invoke a filter and optionally apply tags. Obsessed with the organization, fr fr. π
Words in the configuration file of the form @VAR or @{VAR:default} will be expanded at run-time by setting variable names with the -v option. Variable binding? We love to see it. iykyk. π«Ά
Generated reports consist of comment lines and report lines. Comment lines begin with a # and include details such as the options used, report name, records in the report, and the report line format. Some of the more verbose comments can be controlled with the +header and +xheader options. By default this information is not displayed. A column title beginning with the string rec precedes the report lines. Report lines consist of key fields, such as an IP address and calculated totals for that key such as the number of flows. The summary-detail report is a little bit different from other reports in that it has multiple title lines and no key fields. The column titles are described below. Main character energy, no cap. π
π Column titles π
+time_realβ Difference between the real time of the first and last flow.+aflowtimeβ Total time of the flows / Total number of flows.+apsβ Total Octets / Total Packets (Average Packet Size)+afsβ Total Octets / Total Flows / (Average Flow Size)+apfβ Total Packets / Total Flows (Average Packets / Flow)+fpsβ Total Flows / (Last End Time of Flow - First Start Time of Flow) (Average Flows / Second)+fps_realβ (Average Flows / Second in realtime)+psizeNβ Average Packet Size buckets.+fpsizeNβ Packets / Flow buckets.+fosizeNβ Octets / Flow buckets.+ftimeNβ Time / Flow buckets.ignoresβ Flows with a packet count of 0.SSS-countβ Count of an item, examplesource-ip-address-countSSS*β key fields, examplesource-ip-addressindexβ Report line index.firstβ Time of first flow inunix_secsformat.lastβ Time of last flow inunix_secsformat.flowsβ Summation of flows/key.octetsβ Summation of octets/key.packetsβ Summation of packets/key.durationβ End time of Flow - Start time of Flow.avg-bpsβ Average Bits/Second.min-bpsβ Minimum Bits/Second.max-bpsβ Maximum Bits/Second.avg-ppsβ Average Packets/Second.min-ppsβ Minimum Packets/Second.max-ppsβ Maximum Packets/Second.frecsβ Records used in average calculations.
Note fields with a+are only available in thesummary-detailreport. Periodt. π
The PPS and BPS calculations will not always be correct due to flows which only have one packet, or some other condition where the start time is equal to the end time. In this case these flows are not used in the PPS and BPS calculations. To facilitate aggregating multiple reports and retaining the PPS and BPS fields, the number of flows counted is available in the frecs field. Not me crying over edge cases. π
π stat-report command β Description/Example π
typeβ Define the report type. Example:type destination-tagfilterβ Apply this filter definition. Example:filter permit-only-tcpscaleβ Scale report byn. Example:scale 100tag-maskβ Apply source and destination mask to tag. Example:tag-mask 0xFF00 0xFF00ip-source-address-formatβ Format of source IP address.addressβ address, ie128.146.1.7prefix-lenβ address/len ie128.146.1.7/24prefix-mask-β prefix/len128.146.1/24
ip-destination-address-formatβ Format of destination IP address.addressβ address, ie128.146.1.7prefix-lenβ address/len ie128.146.1.7/24prefix-mask-β prefix/len128.146.1/24
outputβ Start an output configuration. Multiple output configurations can be configured per report.
π output option β Description/Example π
pathβ Pathname of output. If the path begins with a|the output is a pipe. The pathname is formatted throughstrftime(). Directories not in the path are automatically created. Example:path /tmp/%Y/%m/%d/foo.outtimeβ What time to use when formatting the pathname withstrftime.nowβ current timestartβ first flowendβ last flowmidβ average of first and last.
tallyβ Emit a%total line everynrecords. Example:tally 10formatβ Output format. Currently onlyascii. Example:format asciisortβ Sort on a field.+ascending,-descending. Example:sort +flowsβ sort on theflowsfield- Sortable fields are
flows,octets,packets,duration,avg-pps,min-pps,max-pps,avg-bps,min-bps,max-bps
- Sortable fields are
recordsβ Truncate report atnrecords. Example:records 10fieldsβ Enable/Disable fields with+/-. Fields:index,first,last,flows,octets,packets,duration,pps,bps,other,key,key1,key2,key3,key4,count.Example:fields +key,+flows,+octets,+packets,- For reports with one key, the key field is referenced with
key, elsekey1,key2,key3,etc - Note that the
countfield is only available in select reports, those which end in-count.
- For reports with one key, the key field is referenced with
optionsβ Enable/Disable options with+/-+headerβ include header.+xheaderβ include extra header.+totalsβ include a totals line.+percent-totalβ report in%total form.+namesβ use symbolic names.- Example:
options +header,+xheader
π stat-definition option β Description/Example π
filterβ Apply this filter definition. Example:filter defaulttagβ Apply this tag definition. Example:tag defaultmaskβ Apply this mask definition. Example:mask defaultreportβ Invoke this report. Multiple reports can be set. Example:report footime-seriesβ How often to produce a report in seconds. Example:time-series 60
π global options β Description/Example π
include-tagβ Specify path to include tag definitions. Example:include-tag /flows/tags/test1include-filterβ Specify path to include filter definitions. Example:include-filter /flows/filters/test1include-maskβ Specify path to include mask definitions. Example:include-filter /flows/masks/test1
π Report type β Summarization Key Elements π
summary-detailβ Totals plus quick breakdown.summary-countersβ Totals only.packet-sizeβ Average packet size distribution.octetsβ Octets per flow distribution.packetsβ Packets per flow distribution.ip-source-portβ IP Source Port.ip-destination-portβ IP Destination Port.ip-source/destination-portβ IP Source/Destination Port pair.bpsβ Bits/Second distribution.ppsβ Packets/Second distribution.ip-destination-address-typeβ IP class with ASM/SSM Multicast breakout.ip-protocolβ IP Protocol.ip-tosβ IP Type of Service.ip-next-hop-addressβ IP Next Hop Address.ip-source-addressβ IP Source Address.ip-destination-addressβ IP Destination Address.ip-source/destination-addressβ IP Source/Destination Address pair.ip-exporter-addressβ IP Exporter Address.input-interfaceβ Input Interface.output-interfaceβ Output Interface.input/output-interfaceβ Input/Output Interface pair.source-asβ Source AS.destination-asβ Destination AS.source/destination-asβ Source/Destination AS.ip-source-address/source-asβ IP Source Address and Source AS.ip-destination-address/source-asβ IP Destination Address and Source AS.ip-source-address/destination-asβ IP Source Address and Destination AS.ip-destination-address/destination-asβ IP Destination Address and Destination AS.ip-source/destination-address/source-asβ IP Source/Destination Address and Source AS.ip-source/destination-address/destination-asβ IP Source/Destination Address and Destination AS.ip-source/destination-address/source/destination-asβ IP Source/Destination Address and Source/Destination AS.ip-source-address/input-interfaceβ IP Source Address and Input Interface.ip-destination-address/input-interfaceβ IP Destination Address and Input Interface.ip-source-address/output-interfaceβ IP Source Address and Output Interface.ip-destination-address/output-interfaceβ IP Destination Address and Output Interface.ip-source/destination-address/input-interfaceβ IP Source/Destination Address and Input Interface.ip-source/destination-address/output-interfaceβ IP Source/Destination Address and Output Interface.ip-source/destination-address/input/output-interfaceβ IP Source/Destination Address and Input/Output Interface.input-interface/source-asβ Input Interface and Source AS.input-interface/destination-asβ Input Interface and Destination AS.output-interface/source-asβ Output Interface and Source AS.output-interface/destination-asβ Output Interface and Destination AS.input-interface/source/destination-asβ Input Interface and Source/Destination AS.output-interface/source/destination-asβ Output Interface and Source/Destination AS.input/output-interface/source/destination-asβ Input/Output Interface and Source/Destination AS.engine-idβ Engine ID. πengine-typeβ Engine Type.source-tagβ Source Tag.destination-tagβ Destination Tag.source/destination-tagβ Source/Destination Tag.ip-source-address/ip-source-portβ IP Source Address and IP Source Port.ip-source-address/ip-destination-portβ IP Source Address and IP Destination Port.ip-destination-address/ip-source-portβ IP Destination Address and IP Source Port.ip-destination-address/ip-destination-portβ IP Destination Address and IP Destination Port.ip-source-address/ip-source/destination-portβ IP Source Address and IP Source/Destination Port.ip-destination-address/ip-source/destination-portβ IP Destination Address and IP Source/Destination Port.ip-source/destination-address/ip-source-portβ IP Source/Destination Address and IP Source Port.ip-source/destination-address/ip-destination-portβ IP Source/Destination Address and IP Destination Port.ip-source/destination-address/ip-source/destination-portβ IP Source/Destination Address and IP Source/Destination Port.ip-source-address/input/output-interfaceβ IP Source Address and Input/Output Interface.ip-destination-address/input/output-interfaceβ IP Destination Address and Input/Output Interface.ip-source-address/source/destination-asβ IP Source Address and Source/Destination AS.ip-destination-address/source/destination-asβ IP Destination Address and Source/Destination AS.ip-addressβ IP Address (both source and destination, bestie π).ip-portβ IP Port (both source and destination).ip-source-address-destination-countβ Count of destination IP addresses associated with a source IP address.ip-destination-address-source-countβ Count of source IP addresses associated with a destination IP address.linear-interpolated-flows-octets-packetsβ Linear interpolated distribution of flows, octets and packets. The distribution is done across the start and end time of the flow. β¨firstβ First packet of flow distribution.lastβ Last packet of flow distribution.durationβ Duration of flow distribution.ip-source-address/source-tagβ IP Source Address and Source tag.ip-source-address/destination-tagβ IP Source Address and Destination tag.ip-destination-address/source-tagβ IP Destination Address and Source tag.ip-destination-address/destination-tagβ IP Destination Address and Destination tag.ip-source/destination-address/source/destination-tagβ IP Source/Destination Address and Source/Destination tag.ip-source/destination-address/ip-protocol/ip-tosβ IP Source/Destination Address, IP Protocol, and ToS.ip-source/destination-address/ip-protocol/ip-tos/ip-source/destination-portβ IP Source/Destination Address, IP Protocol, IP ToS, IP Source/Destination Port.
β¨ OPTIONS β¨
Like, the actual knobs you get to turn. Not too many, we keep it cute. π
-ddebug_level β Turn on debugging. Yes, the little gremlin logs. π-sstat_fname β The report configuration filename. Defaults to/etc/flow-tools/cfg/statin case you were wondering, and you were wondering.-Sstat_definition β Pick which definition is the active one. Main character selection moment. π-vvariable binding β Set a variable, likeFOO=bar. Very DIY of you.-hβ Display help. And plot twist:-hhwill list the available reports. Double h, double knowledge. π§ β¨
πΈ EXAMPLES πΈ
Okay bestie, here's an example of a report configuration file. Read it like a recipe, it's giving chef vibes π©βπ³:
# stat config file
include-filter /tmp/filter
stat-report t1
type summary-detail
filter default
scale 100
output
format ascii
options +header,+xheader,+totals
fields +other
path /tmp/output1
stat-report t6
type ip-source-port
output
format ascii
options +header,+xheader,+totals,+names,+percent-total
sort +pps
tally 5
path /tmp/output6
stat-definition test
filter tcp
report t1
report t6
# filter config file
filter-primitive TCP
type ip-protocol
permit TCP
filter-definition tcp
match ip-protocol TCP
And then you actually run the thing, like so:
flow-cat flows | flow-report -stest -Stest
That pipe is the moment. π
π«Ά IMPLEMENTATION NOTES π«Ά
Okay so the tea β β here's how the numbers actually work, no cap:
- Packet size calculations are
dOctets / dPkts, ie an average packet size. Periodt. - It is not possible to get a true packet size from flow exports. Like, the data just isn't there. π
ppsandbpscalculations are an average of the averages. Averages of averages, bestie. Do with that what you will.- Flows that do not have a duration (
start == end) are not counted in theppsandbpscalculations. - Flows without a packet or octet count are ignored. Gone. Ghosted. π»
π FILES π
Configuration files, all nestled up in their little homes:
- Symbols β
/etc/flow-tools/sym/* - Tag β
/etc/flow-tools/cfg/tag.cfg - Filter β
/etc/flow-tools/cfg/filter.cfg - Mask β
/etc/flow-tools/cfg/mask.cfg - Report β
/etc/flow-tools/cfg/stat.cfg - Xlate β
/etc/flow-tools/cfg/xlate.cfg
π BUGS π
None known. Not one. Zero. Zilch. The code is, allegedly, flawless. πβ¨
π AUTHOR π
Mark Fullmer <maf@splintered.net>
Absolute icon. We stan. π«Ά
π SEE ALSO π
And that's the whole page, bestie β you made it to the end ππ This was FLOW-REPORT(1) from the 26 ΠΠ²Π³ΡΡΡ 2010 era, so go forth and report those flows. Slay. β¨ππ¦
π¦ where this page comes from
- fedora 43: flow-tools 0.68.5.1-45.fc43 Β· LicenseRef-Callaway-BSD
- fedora 43: flow-tools 0.68.5.1-45.fc43 Β· LicenseRef-Callaway-BSD
- fedora 44: flow-tools 0.68.5.1-46.fc44 Β· LicenseRef-Callaway-BSD
- fedora 44: flow-tools 0.68.5.1-46.fc44 Β· LicenseRef-Callaway-BSD
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms