QSDT(1)

πŸ“¦ version 11.74, in epel 9

πŸ’… QSDT(1) β€” the qsdt man page, bestie edition ✨

okay so real talk: qsdt is that girl who times how long stuff takes between two related log messages. she's in the qsdt man page, she's iconic, let's go πŸŽ€


✨ NAME ✨

qsdt calculates the elapsed time between two related log messages. that's it. that's the whole vibe check. πŸ•


🌸 SYNOPSIS 🌸

qsdt [-t <regex>] -i <regex> -s <regex> -e <regex> [-v] [<path>]

πŸ’– DESCRIPTION πŸ’–

qsdt is a simple little tool (humble queen πŸ’…) that searches for two different messages inside a log file and then calculates the elapsed time between those two lines.

here's the catch tho β€” the two log messages need a common identifier to link them. think an unique request id (UNIQUE_ID), a thread id, or a transaction code. no shared id, no match, no math. periodt. 🫢


πŸ¦‹ OPTIONS πŸ¦‹

  • -t <regex> β€” defines a pattern (a regular expression) that matches the log line's timestamp. this pattern must include two sub-expressions: one matching hours, minutes and seconds, and the other matching the milliseconds. the default pattern is ([0-9]{2}:[0-9]{2}:[0-9]{2})[.,]([0-9]{3}) ✨
  • -i <regex> β€” the pattern (regular expression) matching the identifier that the two messages have in common. the sub-expression defines the part that needs to be extracted from the matching string. πŸ“Œ note: you can also use the start (-s) and end (-e) pattern to define the sub-expression matching this identifier πŸ‘€
  • -s <regex> β€” defines the pattern (regular expression or literal string) identifying the first (start) of the two messages πŸš€
  • -e <regex> β€” defines the pattern (regular expression or literal string) identifying the second (end) of the two messages 🏁
  • -v β€” verbose mode. she talks more. πŸ’¬
  • <path> β€” defines the input file to process. if you omit this parameter, qsdt reads from standard input. (yes, the original page really does say "from from" β€” we don't gatekeep typos around here, we just love her πŸ™ˆ)

πŸŽ€ EXAMPLE πŸŽ€

sample command line arguments, bestie:

-i ' ([a-z0-9]+) [A-Z]+ ' -s 'Received Request' -e 'Received Response'

and these are the sample log messages they'd be matching against:

 2018-03-12 16:34:08.653 threadid23 INFO Received Request
 2018-03-13 16:35:09.891 threadid23 DEBUG MessageHandler Received Response

see how threadid23 is doing the whole linking thing? that's the identifier carrying the whole relationship. main character energy, honestly πŸ‘‘


πŸ”₯ NOTE πŸ”₯

the four patterns (t,i,s,e) get concatenated into two search patterns:

 first (start): [t (HH:MM:SS)(SSS) ].*[i (id) ].*[s ]
 second (end):  [t (HH:MM:SS)(SSS) ].*[i (id) ].*[e ]

and the three sub-expressions are used to extract the timestamp and the unique identifier that the start and end message have in common. πŸ’‘

which means: you could specify the sub-expression for the unique identifier in the start (-s) or the end (-e) pattern alternatively β€” for example, in case the identifier is at the end of the log line. flexible queen 🌈


πŸ‘€ SEE ALSO πŸ‘€

qsexec(1), qsfilter2(1), qsgeo(1), qsgrep(1), qshead(1), qslog(1), qslogger(1), qspng(1), qsre(1), qsrespeed(1), qsrotate(1), qssign(1), qstail(1)

the whole friend group, fr fr 🫢✨


πŸ’œ AUTHOR πŸ’œ

Pascal Buchbinder, http://mod-qos.sourceforge.net/ β€” ty for your service, king 🫑


and that's a wrap, bestie πŸŽ€ this little tour was brought to you by mod_qos utilities 11.74, dated May 2023. go time some logs, you absolute icon πŸ’…βœ¨

πŸ“¦ where this page comes from