Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8954047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:13:44+00:00 2026-06-15T14:13:44+00:00

I have a log file in AIX environment which has lines like below 10.100.108.23

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T14:13:45+00:00Added an answer on June 15, 2026 at 2:13 pm
    awk -F"&" '{for(i=1;i<=NF;i++)if($i~/country/ ||$i~/language/){split($i,a,"=");printf a[2]" "}}' your_file
    

    Or you can use sed:

    sed -e 's/.*country=//g;s/language=\([^\&]*\)&.*/\1/g' your_file
    

    for removing that ampersand:

    > sed -e 's/.*country=//g;s/&language=\([^\&]*\)&.*/ \1/g' temp
    us en
    

    you can read this

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a log file which has lines like below. 10.10.205.100 100.10.56.5 - [23/Oct/2012:15:30:01
I have a log file that has lines that look like this: 1,2546857-23541,f_last,user,4:19 P.M.,11/02/2009,START,27,27,3,c2546857-23541,
I have a log file (.txt) which has information as below: Filename1 - A3332NCDER
I have a log file (.txt) which has information as below: Filename1 - A3332NCDER
I have a log file stored in an SQLite database which I would like
I have a log file which has single strings on each line. I am
I have a log file which contains a number of error lines, such as:
I have a log file which has a format of this kind: DATE-TIME ###
I have a log file with content like this: 2012-07-16 03:20:41,23796160897,Text,id:SAR-23796160897-c0-2-1 sub:000 dlvrd:001 submit
I have a huge log file where there are about 15 million lines. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.