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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:00:17+00:00 2026-05-15T19:00:17+00:00

I have a requirement of parsing both Apache access logs and tomcat logs one

  • 0

I have a requirement of parsing both Apache access logs and tomcat logs one after another using map reduce. Few fields are being extracted from tomcat log and rest from Apache log.I need to merge /map extracted fields based on the timestamp and export these mapped fields into a traditional relational db ( ex. MySQL ).

I can parse and extract information using regular expression or pig. The challenge i am facing is on how to map extracted information from both logs into a single aggregate format or file and how to export this data to MYSQL.

Few approaches I am thinking of

1) Write output of map reduce from both parsed Apache access logs and tomcat logs into separate files and merge those into a single file ( again based on timestamp ). Export this data to MySQL.

2) Use Hbase or Hive to store data in table format in hadoop and export that to MySQL

3) Directly write the output of map reduce to MySQL using JDBC.

Which approach would be most viable and also please suggest any other alternative solutions you know.

  • 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-05-15T19:00:17+00:00Added an answer on May 15, 2026 at 7:00 pm

    It’s almost always preferable to have smaller, simpler MR jobs and chain them together than to have large, complex jobs. I think your best option is to go with something like #1. In other words:

    1. Process Apache httpd logs into a unified format.
    2. Process Tomcat logs into a unified format.
    3. Join the output of 1 and 2 using whatever logic makes sense, writing the result into the same format.
    4. Export the resulting dataset to your database.

    You can probably perform the join and transform (1 and 2) in the same step. Use the map to transform and do a reduce side join.

    It doesn’t sound like you need / want the overhead of random access so I wouldn’t look at HBase. This isn’t its strong point (although you could do it in the random access sense by looking up each record in HBase by timestamp, seeing if it exists, merging the record in, or simply inserting if it doesn’t exist, but this is very slow, comparatively). Hive could be conveinnient to store the “unified” result of the two formats, but you’d still have to transform the records into that format.

    You absolutely do not want to have the reducer write to MySQL directly. This effectively creates a DDOS attack on the database. Consider a cluster of 10 nodes, each running 5 reducers, you’ll have 50 concurrent writers to the same table. As you grow the cluster you’ll exceed max connections very quickly and choke the RDBMS.

    All of that said, ask yourself if it makes sense to put this much data into the database, if you’re considering the full log records. This amount of data is precisely the type of case Hadoop itself is meant to store and process long term. If you’re computing aggregates of this data, by all means, toss it into MySQL.

    Hope this helps.

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

Sidebar

Related Questions

I have one java bean class set values in parsing .My requirement to access
In our project we have requirement that, after receiving sms message from third party
Requirement : To find out which phone the user is using by parsing the
I have a requirement to place 3 kinds of markers on a google map,
I have a string from an RSS file after parsing. String htmlString= <p><img border=1
I have a requirement to both parse existing XML strings (retrieved from a database)
I have a requirement of passing command line parameters when mounting .dmg on MAC
I have requirement where some times I would like to load children as well
I have requirement to disable copy/paste/cut operations on a textbox. For this purpose I
I have requirement, wherein I have to calculate totals for cash and credit cards

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.