AWK/SED print if 2nd character in a column is greater than 0

We have an access log where column 8 displays the time in seconds like below:

Tj8nQAoNgwsAABov9cIAAAFL - 10.13.131.80 - - [07/Aug/2011:17:01:04 -0700] (0) -  "GET /aaaaa/bbbb/bbbb

where column 8 is printed (0). We are trying to find how many entries are there that has column 8 greater than 0.

Remember $8 is (0) and not 0. It has parenthesis around the number.
I tried various commands like below which did not work. Some help might be greatly appreciated.

awk '{print "time=",($8 != "(0)")}' access.log
awk '{print "time="$8 !~/^(0)$/}' access.log
awk '{print $8 !~ /(0)/}' access.log
awk '$8!~"(0)"' access.log
1 Like

sdnlfkdnlvk

Don't hijack other people's threads. Post your problem as a new thread.

That helped me to some extent. Thank you. Is there a way we can print rows whose $8 is greater than 10 secs. $8 is time in seconds, format = (n), parenthesis included.

I did a awk '$8 >"(10)"' access.log which also printed rows < (10) value. Any ideas?

awk '{x=$8;gsub("[()]","",x);if (x>10) print}' access.log