I have a log file in AIX environment which has lines like below
10.100.108.23 100.10.10.11 - [05/Dec/2012:09:35:27 +0000] "GET /chgs/checkprofile/checkServlet?requestType=signPart1&off=false&oquestions=true&userid=false&source=false&link=%23&country=us&language=en&origin=&displayLayer=no HTTP/1.1" 200 8904 "https://www.test.com/services/request/Home.action" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C)" "PD-ERR=; rlang=nl_NL;
I need to find the country and language from each line which comes after the pattern &country and &language respectively. As i am new to shell scripting, i tried to achieve this with grep and awk scripts, but no luck.
Or you can use sed:
for removing that ampersand:
you can read this