Hi All,
Looking for a quick AWK script to output some differences between two files.
FILE1
device1 1.1.1.1 PINGS
device1 2.2.2.2 PINGS
FILE2
2862 SITE1 device1-prod 1.1.1.1 icmp - 0
2862 SITE2 device2-prod 1.1.1.1 icmp - 0
OUTPUT_FILE
device1 1.1.1.1 PINGS
Basically column two in FILE1 needs to match in Column 4 in FILE2 and output the match from FILE1 in the output file.
My Script at the moment is
awk 'NR==FNR{++a[$4];next}!a[$2]' FILE2 FILE1 > OUTPUT_FILE
But this gives me
2862 SITE1 device1-prod 1.1.1.1 icmp - 0
Can someone help refine the AWK command.
Thanks all
Stacky