[bash] get user unknown ip from maillog
hi guys can u help here..
i can't find a command or any bash script to get ip for User unknown in my maillog file. I had try to grep that line contain User unknown tag like this : grep '[.][.][.] User unknown' maillog but unfornately the ip was not in the line. Realized that the ip state one line after that. Somebody please help.. |
man grep; grep -A, -C
|
thanks digiot!!
no reason to preasure out till forgot the man page :-lol :p anyway this is my edit command to get the ip : grep -A 1 '[.][.][.] User unknown' maillog | egrep -o -e "[0-9]{2,3}\.[0-9]{2,3}\.[0-9]{2,3}\.[0-9]{2,3}" |
All times are GMT -5. The time now is 05:41 PM. |