FLOW-EXPORT(1)

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

FLOW-EXPORT(1) πŸ’–

okay bestie, welcome to flow-export from the flow-tools family β€” this is the little utility that takes your flow-tools flow files and yeets them into other NetFlow packages. group chat for network data, basically. let's get into it 🫢


✨ SYNOPSIS ✨

flow-export [ -h ] [ -d debug_level ] [ -f format ] [ -m mask_fields ]
            [ -u user:password:host:port:name:table ]

🌸 DESCRIPTION 🌸

so flow-export converts flow-tools flow files into these formats: ASCII CSV, cflowd, pcap, wire, mySQL, and PGSQL. that's it, that's the whole job, and it does it flawlessly πŸ’…


πŸŽ€ OPTIONS πŸŽ€

  • -d debug_level β€” turns on debugging. yes queen, show us the internals πŸ”
  • -f format β€” which export format you want. the supported ones are: 0 cflowd, 1 pcap, 2 ASCII CSV, 3 MySQL, 4 wire, 5 PGSQL ✨
  • -h β€” display help. when in doubt, ask for help, it's giving self-care 🫢
  • -m mask_fields β€” picks the fields for the MySQL, PostgresSQL, cflowd, and ASCII formats. you build mask_fields by bitwise-OR-ing the constants below together 🧩

here's the whole menu, no cap:

UNIX_SECS       0x0000000000000001LL
UNIX_NSECS      0x0000000000000002LL
SYSUPTIME       0x0000000000000004LL
EXADDR          0x0000000000000008LL

DFLOWS          0x0000000000000010LL
DPKTS           0x0000000000000020LL
DOCTETS         0x0000000000000040LL
FIRST           0x0000000000000080LL

LAST            0x0000000000000100LL
ENGINE_TYPE     0x0000000000000200LL
ENGINE_ID       0x0000000000000400LL

SRCADDR         0x0000000000001000LL
DSTADDR         0x0000000000002000LL
SRC_PREFIX      0x0000000000004000LL
DST_PREFIX      0x0000000000008000LL
NEXTHOP         0x0000000000010000LL
INPUT           0x0000000000020000LL
OUTPUT          0x0000000000040000LL
SRCPORT         0x0000000000080000LL

DSTPORT         0x0000000000100000LL
PROT            0x0000000000200000LL
TOS             0x0000000000400000LL
TCP_FLAGS       0x0000000000800000LL

SRC_MASK        0x0000000001000000LL
DST_MASK        0x0000000002000000LL
SRC_AS          0x0000000004000000LL
DST_AS          0x0000000008000000LL

IN_ENCAPS       0x0000000010000000LL
OUT_ENCAPS      0x0000000020000000LL
PEER_NEXTHOP    0x0000000040000000LL
ROUTER_SC       0x0000000080000000LL
EXTRA_PKTS      0x0000000100000000LL
MARKED_TOS      0x0000000200000000LL

and heads up, when you're exporting to cflowd format, this mask_fields field is actually the cflowd mask, which is defined like this πŸ‘‡

ROUTERMASK         0x00000001
SRCIPADDRMASK      0x00000002
DSTIPADDRMASK      0x00000004
INPUTIFINDEXMASK   0x00000008
OUTPUTIFINDEXMASK  0x00000010
SRCPORTMASK        0x00000020
DSTPORTMASK        0x00000040
PKTSMASK           0x00000080
BYTESMASK          0x00000100
IPNEXTHOPMASK      0x00000200
STARTTIMEMASK      0x00000400
ENDTIMEMASK        0x00000800
PROTOCOLMASK       0x00001000
TOSMASK            0x00002000
SRCASMASK          0x00004000
DSTASMASK          0x00008000
SRCMASKLENMASK     0x00010000
DSTMASKLENMASK     0x00020000
TCPFLAGSMASK       0x00040000
INPUTENCAPMASK     0x00080000
OUTPUTENCAPMASK    0x00100000
PEERNEXTHOPMASK    0x00200000
ENGINETYPEMASK     0x00400000
ENGINEIDMASK       0x00800000

INDEX_V1_MASK      0x00043FFF
INDEX_V5_MASK      0x00C7FFFF
INDEX_V6_MASK      0x00FFFFFF
INDEX_V7_MASK      0x00C7FFFF
INDEX_V8_1_MASK    0x00C0CD99
INDEX_V8_2_MASK    0x00C00DE1
INDEX_V8_3_MASK    0x00C14D8B
INDEX_V8_4_MASK    0x00C28D95
INDEX_V8_5_MASK    0x00C3CD9F

the default is all fields applicable to the flow file, or the cflowd INDEX mask applicable to the export format. so like, if you don't say anything, it just picks the right vibes for you 😌

  • -u user:password:host:port:name:table β€” configures MySQL or PostgresSQL access. all six parts, bestie, don't skip any πŸ”

πŸ”₯ EXAMPLES πŸ”₯

example the first

convert the flow-tools file flows to the cflowd file flows.cflowd, including all fields.

flow-export -f0 < flows > flows.cflowd

πŸ”₯ EXAMPLES πŸ”₯

example the second

convert the flow-tools file flows to ASCII, including the SRCADDR and DSTADDR fields.

flow-export -f2 -m0x3000 < flows > flows.ascii

πŸ”₯ EXAMPLES πŸ”₯

example the third

export the flow-tools file flows into a MySQL database, including only SRCADDR, DSTADDR and DOCTETS.

flow-export -f3 -mSRCADDR,DSTADDR,DOCTETS -u "user:password:host:port:name:table" < flows

πŸ’€ BUGS πŸ’€

the pcap format is a hack. not me exposing the manpage's own self-drag 😭 iconic honestly.

πŸ‘‘ AUTHOR πŸ‘‘

Mark Fullmer <maf@splintered.net> πŸ’œ

Database Support: William Emmanuel Yu <wyu@ateno.edu> πŸ¦‹


🌈 SEE ALSO 🌈


and that's the whole page bestie, you ate it up fr fr πŸŽ€ this lil gem lives in the flow-tools source, dated 26 Август 2010, and it's filed under FLOW-EXPORT(1) β€” iykyk βœ¨πŸ’…πŸ¦‹

πŸ“¦ where this page comes from