Hi monks,
I am trying to extract the web page report log, which will genarate when i clicked any of the link in a web page.
The request and response will be in xml format. There are no of clicks from different ipaddress, i want to see
the request log which genarated from a specific ipaddress. At present i am using perl one liner command which i got from the perl monks.
perl -ane 'print if /<request>/../</request>/' | tail -f logfile
By this i am able to see the xml log from the <request> to </request> tag.It is very difficult for
searching the request log from a specific ip address.The log format is as below
<?xml version="1.0" encoding="UTF-8"?><status>SUCCESS</status> /***********For QA only ****************/ <?xml version="1.0" encoding="UTF-8"?> <request> <visitorID>a4379158-2fb5-494b-a195-ee2cc44df2a2</visitorID> <reportSuiteID>aolmobilewebdev</reportSuiteID> <pageName>wpt: help_pv</pageName> <pageURL>http://mqa.aol.com/portal/default/help.do?icid=ft_help</pageU +RL> <ipAddress>64.12.218.80</ipAddress> <userAgent>ApacheBench/2.0.41-dev</userAgent> <scXmlVer>1.0</scXmlVer> <timezone>-5</timezone> <channel>us.wptportal</channel> <referrer></referrer> <events>event10</events> <server>qawire-ql26.tweb.aol.com</server> <eVar16>ft_help</eVar16> <prop1>wpt: portal</prop1> <prop2>wpt: Help Page</prop2> <prop3>gmt_5</prop3> <prop10>ApacheBench/2.0.41-dev</prop10> <prop12>http://mqa.aol.com/portal/default/help.do</prop12> <prop13>non-authenticated</prop13> <prop14>no referrer</prop14> <prop24>uaid_na</prop24> <prop49>xml api</prop49> </request> <?xml version="1.0" encoding="UTF-8"?><status>SUCCESS</status> /***********For QA only ****************/ <?xml version="1.0" encoding="UTF-8"?> <request> <visitorID>c8b26ed4-3370-4402-abd7-b0519c51d80c</visitorID> <reportSuiteID>aolmobilewebdev</reportSuiteID> <pageName>wpt: help_pv</pageName> <pageURL>http://mqa.aol.com/portal/default/help.do?icid=ft_help</pageU +RL> <ipAddress>10.146.163.43</ipAddress> <userAgent>ApacheBench/2.0.40-dev</userAgent> <scXmlVer>1.0</scXmlVer> <timezone>-5</timezone> <channel>us.wptportal</channel> <referrer></referrer> <events>event10</events> <server>qawire-ql26.tweb.aol.com</server> <eVar16>ft_help</eVar16> <prop1>wpt: portal</prop1> <prop2>wpt: Help Page</prop2> <prop3>gmt_5</prop3> <prop10>ApacheBench/2.0.40-dev</prop10> <prop12>http://mqa.aol.com/portal/default/help.do</prop12> <prop13>non-authenticated</prop13> <prop14>no referrer</prop14> <prop24>uaid_na</prop24> <prop49>xml api</prop49> </request> <?xml version="1.0" encoding="UTF-8"?><status>SUCCESS</status> /***********For QA only ****************/ <?xml version="1.0" encoding="UTF-8"?> <request> <visitorID>420ea1fe-c93e-4209-bee9-e548de8ea1c5</visitorID> <reportSuiteID>aolmobilewebdev</reportSuiteID> <pageName>wpt: help_pv</pageName> <pageURL>http://mqa.aol.com/portal/default/help.do?icid=ft_help</pageU +RL> <ipAddress>64.12.218.64</ipAddress> <userAgent>ApacheBench/2.0.41-dev</userAgent> <scXmlVer>1.0</scXmlVer> <timezone>-5</timezone> <channel>us.wptportal</channel> <referrer></referrer> <events>event10</events> <server>qawire-ql26.tweb.aol.com</server> <eVar16>ft_help</eVar16> <prop1>wpt: portal</prop1> <prop2>wpt: Help Page</prop2> <prop3>gmt_5</prop3> <prop10>ApacheBench/2.0.41-dev</prop10> <prop12>http://mqa.aol.com/portal/default/help.do</prop12> <prop13>non-authenticated</prop13> <prop14>no referrer</prop14> <prop24>uaid_na</prop24> <prop49>xml api</prop49> </request>
I want to see the log </request> to </request> which is from the ipaddress:10.146.163.43

Appreciate your assistance!

In reply to How i can extract the part of server report log based on Ipaddress by perladdict

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.