[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 555
  • Last Modified:

grep or awk

I would like to print the MSISDN(mycingular.net format but unique word is .net) from tomcat access logs

I like to know how many MSISDN in the log file.
0
arvind
Asked:
arvind
  • 3
  • 3
1 Solution
 
uniquesCommented:
What is the format of the access logs? And how is MSISDN differentiated from other log entries?
0
 
arvindAuthor Commented:
example
HTTP/1.1" 200 2570 12.129.8.10 - - [06/Apr/2006:00:29:54 +0000] "GET /some/test/tent.jsp? QIID=11271014778774edewdewd1215515&uid=SWM_ewcxwdc13252_vmag.mycingular.net HTTP/1.1" 302 -

so I need to catch uid="some_numbere_mycingular.net" and print it
0
 
uniquesCommented:
If you want to extract uid=<sometihing>mycingular.net part from the line and print it, try
grep mycingular.net logfilename | sed 's/.*\(uid=.*mycingular\.net\).*/\1/'
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
arvindAuthor Commented:
in the output-- uid= also comming-- can we removed uid= from the result
0
 
uniquesCommented:
Try
grep mycingular.net logfilename | sed 's/.*uid=\(.*mycingular\.net\).*/\1/'
0
 
arvindAuthor Commented:
thnx its working
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now