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 8176685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:17:42+00:00 2026-06-06T23:17:42+00:00

I have an extensive set of Apache logs that I’m looking to parse. Specifically,

  • 0

I have an extensive set of Apache logs that I’m looking to parse. Specifically, there is a PHP script that runs on the site that passes arguments to a database to filter results to the public. This script, called “searchbox.php” passes three arguments (in its URL) that I’m interested in the results for:

  • engine
  • query
  • subengine

The rest of the information is not valuable for me at this time. Here is the format for a single log entry:

sub.domain.com 123.456.789.456 - - [28/Jun/2012:00:04:00 -0500] "GET /sitescripts/search-box/searchbox.php?engine=catalog-vs-worldcat&query=law+enforcement+articles&x=0&y=0&subengine=iiikw HTTP/1.1" 302 20 "http://sub.domain.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:12.0) Gecko/20100101 Firefox/12.0" - 0

The information I need is in the GET request, I just need a clean way of pulling those three bits of information out from these large log files and dumping it into either a CSV or tab delimited file.

I imagine this will be done in PHP but I will also entertain Python as well.

  • 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-06T23:17:43+00:00Added an answer on June 6, 2026 at 11:17 pm

    You could use regexes…

    re_str = r"\?engine=(?P<eng>[\w-]*?)&query=(?P<query>[=\d\+\w-]*?)&subegine=(?P<sub>\w*)\s"
    reg = re.compile(re_str)
    for line in file:
      m = reg.search(line)
      print "Engine", m.group("eng")
      print "Query", m.group("query")
      print "Sub", m.group("sub")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have quite an extensive PHP script that I have to run on my
I have a webforms page that makes quite extensive use of AJAX. There are
I have been trying to set up curl with php 5 and apache 2.2
I have a PHP application that makes extensive use of Javascript on the client
I have a SOAP result set that the nuSoap extension has turned into a
I have a huge java codebase (more than 10,000 java classes) that makes extensive
I have a page in one of my client's websites that generates an extensive
We have inherited an application (Java-based, running on WebLogic 10.3.5) that makes extensive use
I have a large Perl script that is broken into several Perl libraries. In
Background: I have an extensive set of specialized VBA macros used in Word for

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.