XIII
Very Senior Member
I was looking for an awk equivalent of Python's -3 index for "third from the end".You want the third field from the right?
Code:awk '/query\[AAAA]|query\[A]/ {print $(NF-2)}' /opt/var/log/dnsmasq.log
This does exactly that. Cool!