ZEEK-CUT(1)

πŸ“¦
version 6.0.4 Β· 2 versions
, in fedora 43, fedora 44, nixos 26.05, nixpkgs unstable

πŸ’– ZEEK-CUT(1) πŸ’–

okay bestie, so this is zeek-cut, part of the User Commands squad. it's giving "tiny tool, huge main character energy." let's get into it πŸ¦‹


✨ NAME ✨

zeek-cut β€” parse Zeek logs πŸ’…


🌸 SYNOPSIS 🌸

zeek-cut [options] [columns]

πŸŽ€ DESCRIPTION πŸŽ€

so basically: you pipe some ASCII Zeek logs into standard input, you tell it which columns you want, and it spits those columns right back out to standard output. that's it. that's the vibe. ✨

if you don't name any fields at all? no stress, it selects all of them. and by default, zeek-cut does not include format header blocks in the output. nope, not doing that unless you ask. πŸ™ˆ

now, how do you ask for columns? you give a list of field names, separated by spaces. and here's the slay part: the order you give them in is the order they come out. so if you're feeling chaotic and want to shuffle things around, zeek-cut is literally your reordering bestie. πŸ‘‘

🚨 important, no cap: the ASCII Zeek logs you feed in on standard input must have intact format header blocks. like, they need them. zeek-cut uses that info to correctly interpret the log file format. can't do the math without the numbers, you know? 😭

and here's the flex β€” zeek-cut can also handle the concatenation of multiple ASCII log files that have different column layouts. yeah. multiple logs, different shapes, one pipe. iconic. 🫢


πŸ’… OPTIONS πŸ’…

  • -c β€” include the first format header block in the output. just the one. baby steps. ✨
  • -C β€” include all format header blocks in the output. go big or go home. πŸ”₯
  • -m β€” same as -c (first format header block, hello) but in minimal view. cute and compact. πŸŽ€
  • -M β€” same as -C (all the format header blocks) but in minimal view. maximal content, minimal styling. the duality. πŸ’œ
  • -d β€” convert time values into human-readable format. because raw timestamps are not it. πŸ•°οΈ
  • -D <fmt> β€” like -d, but you get to specify the format for time. peep strftime(3) for the syntax, iykyk. 🧚
  • -F <ofs> β€” sets a different output field separator character. default separator not your thing? change it. πŸ’«
  • -h β€” show help. when in doubt, ask for help. we love a self-aware icon. πŸ™‹β€β™€οΈ
  • -n β€” print all fields except the ones you specified. yes, it's the inverse. yes, it's still valid. no, it's not a typo. 😌
  • -u β€” like -d, but print timestamps in UTC instead of local time. timezone girlies rise. 🌍
  • -U <fmt> β€” like -D, but print timestamps in UTC instead of local time. same energy, different clock. ⏰

🌈 ENVIRONMENT 🌈

  • ZEEK_CUT_TIMEFMT β€” for the time conversion options -d or -u, you can set the format string by setting this environment variable instead. set it once, vibe forever. ✨

πŸ“ EXAMPLES πŸ“

output three columns and convert time values:

cat conn.log | zeek-cut -d ts id.orig_h id.orig_p

output all columns and convert time values with a custom format string:

cat conn.log | zeek-cut -D "%Y-%m-%d %H:%M:%S"

compressed logs must be uncompressed with another utility:

zcat conn.log.gz | zeek-cut
πŸ’€ reminder bestie: zeek-cut does not unzip anything for you. zcat (or your decompressor of choice) handles that first, then you hand it over. don't @ me.

πŸ‘€ SEE ALSO πŸ‘€

strftime(3) β€” go read it, it's where the format syntax lives 🫢


πŸ’– AUTHOR πŸ’–

zeek-cut was written by The Zeek Project <info@zeek.org>. legends, honestly. πŸ‘‘


and that's the whole page, bestie!! this one's from zeek-cut, dated November 2014, sitting pretty in section 1 of the manual. go forth and parse. periodt. πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from