<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Perl script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script/m-p/3003736#M127022</link>
    <description>thats wierd...I dont have a reply button, but if I hit return in the attachment field, it submits...and my attachment opens up through explorer as a webpage instead of as a text file....well, hope you can still get it ;)</description>
    <pubDate>Fri, 20 Jun 2003 18:12:40 GMT</pubDate>
    <dc:creator>Ken Penland_1</dc:creator>
    <dc:date>2003-06-20T18:12:40Z</dc:date>
    <item>
      <title>Perl script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script/m-p/3003734#M127020</link>
      <description>I am writing a script to parse web logs, this script captures IP, DATE and TIME and&lt;BR /&gt;Requested page in $host, $date, $request variables. How do I capture&lt;BR /&gt;"&lt;A href="http://www.portallink.com/finder.jhtml" target="_blank"&gt;http://www.portallink.com/finder.jhtml&lt;/A&gt;" in another variable $url in the same way. &lt;BR /&gt;&lt;BR /&gt;Script:&lt;BR /&gt;#!/usr/bin/perl -w&lt;BR /&gt;&lt;BR /&gt;$logfile = shift || &amp;amp;usage;&lt;BR /&gt;&lt;BR /&gt;# forward declarations&lt;BR /&gt;my ($host, $date, $request);&lt;BR /&gt;&lt;BR /&gt;# open the log&lt;BR /&gt;open(LOG, "&amp;lt;$logfile") or die "could not open $logfile\n";&lt;BR /&gt;&lt;BR /&gt;while(&lt;LOG&gt;) {&lt;BR /&gt;  ($host, $date, $request) =&lt;BR /&gt;    $_ =~ m{&lt;BR /&gt;      (.*?)\s       # host name or IP&lt;BR /&gt;      \[(.*?)\]\s   # date&lt;BR /&gt;      \"(.*?)\"\s   # request method&lt;BR /&gt;      }x;&lt;BR /&gt;&lt;BR /&gt;print "$host $date $request \n";&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Sample web log&lt;BR /&gt;216.177.64.101 - - [09/Apr/2003:00:00:41 -0400] "GET /logout.jhtml HTTP/1.0" 200 15758 "&lt;A href="http://www.portallink.com/finder.jhtml" target="_blank"&gt;http://www.portallink.com/finder.jhtml&lt;/A&gt;" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" "ProfileCookie=demositelite,XYZ Company, Inc.,; JSESSIONID=OCZA0EYAAACSYCQFAKLSFEQKAUBJQI5G; anonauth=XYZuser%40XUMA123g; auth=demosite%40a3f7edcd509ca46e516f0249cbdc5f53; XYZdomain=&lt;A href="http://www.portallink.com" target="_blank"&gt;www.portallink.com&lt;/A&gt;"&lt;BR /&gt;216.177.64.101 - - [09/Apr/2003:00:00:44 -0400] "GET /index.jhtml;jsessionid=OC0BPEIAAACS2CQFAKLSFEQKAUBJQI5G;jsessionid=OC0BPEIAAACS2CQFAKLSFEQKAUBJQI5G?LOGOUT=yes&amp;amp;DPSLogout=true&amp;amp;_requestid=42166 HTTP/1.0" 200 8194 "&lt;A href="http://www.portallink.com/logout.jhtml" target="_blank"&gt;http://www.portallink.com/logout.jhtml&lt;/A&gt;" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" "ProfileCookie=demosite,XYZ Company, Inc.,; JSESSIONID=OC0BPEIAAACS2CQFAKLSFEQKAUBJQI5G; anonauth=XYZuser%40XUMA123g; auth=demosite%40a3f7edcd509ca46e516f0249cbdc5f53; XYZdomain=&lt;A href="http://www.portallink.com" target="_blank"&gt;www.portallink.com&lt;/A&gt;"&lt;BR /&gt;216.177.64.101 - - [09/Apr/2003:00:00:45 -0400] "GET /index.jhtml HTTP/1.0" 200 19243 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" "ProfileCookie=demosite,XYZ Company, Inc.,; JSESSIONID=OC0BPEIAAACS2CQFAKLSFEQKAUBJQI5G; anonauth=XYZuser%40XUMA123g; auth=demosite%40a3f7edcd509ca46e516f0249cbdc5f53; XYZdomain=&lt;A href="http://www.portallink.com" target="_blank"&gt;www.portallink.com&lt;/A&gt;"&lt;BR /&gt;&lt;BR /&gt;Output from the script&lt;BR /&gt;./parse.pl sample&lt;BR /&gt;216.177.64.101 - - 09/Apr/2003:00:00:41 -0400 GET /logout.jhtml HTTP/1.0 &lt;BR /&gt;216.177.64.101 - - 09/Apr/2003:00:00:44 -0400 GET /index.jhtml;jsessionid=OC0BPEIAAACS2CQFAKLSFEQKAUBJQI5G;jsessionid=OC0BPEIAAACS2CQFAKLSFEQKAUBJQI5G?LOGOUT=yes&amp;amp;DPSLogout=true&amp;amp;_requestid=42166 HTTP/1.0 &lt;BR /&gt;216.177.64.101 - - 09/Apr/2003:00:00:45 -0400 GET /index.jhtml HTTP/1.0 &lt;BR /&gt;&lt;BR /&gt;Thanks in advance&lt;/LOG&gt;</description>
      <pubDate>Fri, 20 Jun 2003 17:53:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-script/m-p/3003734#M127020</guid>
      <dc:creator>robert_177</dc:creator>
      <dc:date>2003-06-20T17:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: Perl script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script/m-p/3003735#M127021</link>
      <description>I do pretty much what you are talking about...I have a webpage that shows the contents of the access_log, filters out some stuff I dont want to see, and gives each line a radio button so I can remove everything older than it once I have reviewed it....the contents in my page is ip, user date/time method, and url.....it looks nothing like your perl script, but hopefully it will give you an idea or two...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 20 Jun 2003 18:10:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-script/m-p/3003735#M127021</guid>
      <dc:creator>Ken Penland_1</dc:creator>
      <dc:date>2003-06-20T18:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: Perl script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script/m-p/3003736#M127022</link>
      <description>thats wierd...I dont have a reply button, but if I hit return in the attachment field, it submits...and my attachment opens up through explorer as a webpage instead of as a text file....well, hope you can still get it ;)</description>
      <pubDate>Fri, 20 Jun 2003 18:12:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-script/m-p/3003736#M127022</guid>
      <dc:creator>Ken Penland_1</dc:creator>
      <dc:date>2003-06-20T18:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: Perl script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script/m-p/3003737#M127023</link>
      <description>Hello!&lt;BR /&gt;&lt;BR /&gt;Something like \"http\:\/\/(.*?)\"\s &lt;BR /&gt;&lt;BR /&gt;Caesar</description>
      <pubDate>Fri, 20 Jun 2003 18:13:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-script/m-p/3003737#M127023</guid>
      <dc:creator>Caesar_3</dc:creator>
      <dc:date>2003-06-20T18:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: Perl script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script/m-p/3003738#M127024</link>
      <description>Ken,&lt;BR /&gt;Could you please send that script to rgoud@yahoo.com.&lt;BR /&gt;Thanks</description>
      <pubDate>Fri, 20 Jun 2003 19:33:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-script/m-p/3003738#M127024</guid>
      <dc:creator>robert_177</dc:creator>
      <dc:date>2003-06-20T19:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: Perl script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script/m-p/3003739#M127025</link>
      <description>use FileHandle;&lt;BR /&gt;&lt;BR /&gt;$input_file = $ARGV[0];&lt;BR /&gt;&lt;BR /&gt;chomp($input_file);&lt;BR /&gt;&lt;BR /&gt;$INFILE = new FileHandle;&lt;BR /&gt;&lt;BR /&gt;$INFILE-&amp;gt;open ($input_file, "r");&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;while ( !$INFILE-&amp;gt;eof ) {&lt;BR /&gt;&lt;BR /&gt; $line = $INFILE-&amp;gt;getline;&lt;BR /&gt;&lt;BR /&gt;  if($line =~ /http\:\/\/&lt;A href="http://www.portalink.com/)" target="_blank"&gt;www.portalink.com/)&lt;/A&gt; {&lt;BR /&gt;&lt;BR /&gt;  $name_flag=1;&lt;BR /&gt; &lt;BR /&gt;  while($name_flag &amp;amp;&amp;amp; !$INFILE-&amp;gt;eof) {&lt;BR /&gt; {&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;that is a start for a multiple seach inside a paragraph.&lt;BR /&gt;&lt;BR /&gt;also if you want to search for diffrent lines&lt;BR /&gt;continue with &lt;BR /&gt;&lt;BR /&gt;} elsif { ($line =~ /what ever/) {&lt;BR /&gt;  bla bla bla&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;have fun.......&lt;BR /&gt;&lt;BR /&gt;donny</description>
      <pubDate>Sat, 21 Jun 2003 00:28:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-script/m-p/3003739#M127025</guid>
      <dc:creator>Donny Jekels</dc:creator>
      <dc:date>2003-06-21T00:28:54Z</dc:date>
    </item>
    <item>
      <title>Re: Perl script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script/m-p/3003740#M127026</link>
      <description>hey sorry the else if is incorrect&lt;BR /&gt;&lt;BR /&gt;do something liek this.&lt;BR /&gt;&lt;BR /&gt;if ($line =~ /http\:\/\/www.portalink/ {&lt;BR /&gt;    do-something&lt;BR /&gt;} eslif ($line =~ /sessionid/) {&lt;BR /&gt;     do-anotherthing&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;that ends the if statement, however you can have endless elsif's&lt;BR /&gt;&lt;BR /&gt;the power of perl&lt;BR /&gt;&lt;BR /&gt;peace</description>
      <pubDate>Sat, 21 Jun 2003 00:36:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-script/m-p/3003740#M127026</guid>
      <dc:creator>Donny Jekels</dc:creator>
      <dc:date>2003-06-21T00:36:10Z</dc:date>
    </item>
  </channel>
</rss>

