Print lines where a column value exceeds a threshold
awk print lines where column greater than | show only lines with large values | awk condition on column | awk | filter | columnsawk -v c=10 -v min=5000000 '$c + 0 > min + 0' /var/www/vhosts/system/example.com/logs/access_ssl_logPrints only the lines whose value in the chosen column is greater than the threshold. The + 0 forces a numeric comparison, otherwise awk might compare strings. In the example it shows all requests in an access log with a response size above 5 MB.
Note: <, >= or == work instead of > as well. For text comparisons, drop the + 0 and put the value in quotes.
Also searched as
- awk print lines where column greater than
- show only lines with large values
- awk condition on column