No, given a bunch of Apache logs I needed to find the top 10 queries that met conditions A and B.
1. grepping for conditions and extracting the query with sed
2. appending a char to a flat file (i.e. increasing query count by 1)
3. sort by largest files and get the top 10
Parsing log files[0]:
for ./*.log -type f -exec echo 1 >> $(grep cond_A {} | grep cond_B | sed -E "s:.*(query).*:./results/\1.txt:") \;
Finding top 10 results: ls ./results/*.txt -Sl | head
[0]: Untested code, and it only grabs one line per log file instead of grepping all matching lines in the log file. I'd have to move the grep to the outside and loop the `echo 1 >>` command, but you get the point.