I've been doing some searching and I'm having a tough time trying to figure out what I'm trying to do.
I'm running an nmap scan with the -oG option to grep the info.
I am looking to end up with a test file with the following format:
I'm grepping for specific services and want to output it in that format, as the next tool I want to run needs the data that way.
I can grep the IP with:
cat logfile |grep http |cut -d" " -f2
And I can grep the port with:
cat logfile |grep http |cut -d" " -f4 |cut -d"/" -f1
I just need to figure out how to grep those two things out and put the out put on the same line with a comma separating them.
I'm doing this for an automation exercise I'm working on.
Any help would be greatly appreciated! Thanks