Hands-on task
This task is step 9 of the course “Logs: analysis and housekeeping”
Median SQL query time
/var/log/db/queries.txt has lines QUERY_ID MS — how many milliseconds each database query took. There is an odd number of values. Find the median time (the middle element of the series sorted in ascending order) and write the number to /root/db_median.txt.
What you'll practise:
- median
- sort -n
- awk
- array by NR
- column selection