linux - Collect data from a named pipe for a period of time -
i want analyse data named pipe, example:
cat trace_pipe | awk '{print $6}' | head -100000 | sort | uniq -c | sort -k 1 -nr
this command collect first 100k lines of data trace_pipe
. there way me collect data 10 seconds rather limited number of lines?
you can use timeout
command, might need split commands
timeout 10 cat trace_pipe > trace_pipe.cut awk '{print $6}' trace_pipe.cut | sort | uniq -c | sort -k 1 -nr
Comments
Post a Comment