Filter IP Adresses to file
I'm a Linux newbie, so please forgive me if this is an easy question.
I need to filter (grep, awk, etc.) out all the IP addresses from /var/log/secure that attempt to access a my server to a file and sort them.
I can get the lines containing the addresses with grep and know to use sort | uniq -u to get them in order and delete duplicate entries, but I don't know how to accurately get out each IP address.
It would be possible to awk out each entry based on it's position in the string, but there must be a more accurate and more efficient way to do this.
Thanks so much for your assistance!