Overview: I need to be able to use a regular expression to display only parts of a line that match the expression.
Input: A file that is filled with error messages from different hosts. Each line has an error message and the IP address that caused the error.
Desired Output: A list of all the IP addresses found in the file.
Here is what I have currently. It returns the proper lines, but I only want to print the part of the line that matches, so I end up with a list of IP addresses only. The IP address could be located anywhere in the line so I cant use something like awk to just print the proper field - it will be different for each returned line.
Thanks in advance guys