Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12201

I need to alter the input fields using AWK command - perform shell command operation on one of the input field & display

$
0
0
cat test-file.log |awk '{print $1,command executed on $1}'

Example - I am getting ipaddress in $1 - so I need to display output like

Address |  Reverse dns lookup on the IP 8.8.4.4    | dns.google
  • $1 - is count of specific IP logged
  • $2 - is IP Address
  • $3 - modified to display - the reverse dns operation on $1

I am not able to do reverse lookup on the filed $2(IP address)


Viewing all articles
Browse latest Browse all 12201

Trending Articles