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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T12:34:18+00:00 2026-06-02T12:34:18+00:00

A while back I created a log parser. The logs can be several thousands

  • 0

A while back I created a log parser. The logs can be several thousands of lines up to millions of lines. I store the parsed entries in an array of hash refs.

I am looking for suggestions on how to store my output, so that I can quickly read it back in if the script is run again (this prevents the need to re-parse the log).

The end goal is to have a web interface that will allow users to create queries (basically treating the parsed output like it existed within a database).

I have already considered writing the output of Data::Dumper to a file.

Here is an example array entry printed with Data::Dumper:

$VAR = 
          {
            'weekday' => 'Sun',
            'index' => 26417,
            'timestamp' => '1316326961',
            'text' => 'sys1  NSP
Test.cpp      1000
This is a example error message.
',
            'errname' => 'EM_TEST',
            'time' => {
                        'array' => [
                                     2011,
                                     9,
                                     18,
                                     '06',
                                     22,
                                     41
                                   ],
                        'stamp' => '20110918062241',
                        'whole' => '06:22:41',
                        'hour' => '06',
                        'sec' => 41,
                        'min' => 22
                      },
            'month' => 'Sep',
            'errno' => '2261703',
            'dayofmonth' => 18,
            'unknown2' => '1',
            'unknown3' => '1',
            'year' => 2011,
            'unknown1' => '0',
            'line' => 219154
          },`

Is there a more efficient way of accomplishing my goal?

  • 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-02T12:34:25+00:00Added an answer on June 2, 2026 at 12:34 pm

    If your output is an object (or if you want to make it into an object), then you can use KiokuDB (along with a database back end of your choice). If not, then you can use Storable. Of course, if your data structure essentially mimics a CSV file, then you can just write the output to file. Or you can output the data into a JSON object that you can store in a file. Or you can forgo the middleman and simply use a database.

    You mentioned that your data structure is a “array of hashes” (presumably you mean an array of hash references). If the keys of each hash reference are the same, then you can store this in CSV.

    You’re unlikely to get a specific answer without being more specific about your data.

    Edit: Now that you’ve posted some sample data, you can simply write this to a CSV file or a database with the values for index,timestamp,text,errname,errno,unknown1,unknown2,unknown3, and line.

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

Sidebar

Related Questions

I created several apps in iOS a while back using PhoneGap 1.0 and several
A while back I created a lightbox plugin using jQuery that would load a
I have a .sql file that was created by postgresql a while back. I
A while back I created an app ID on facebook and added the appropriate
I created a program with a Swing GUI in NetBeans a while back using
A while back I created a REAL BASIC appointment scheduling form (again, emphasis on
A while back i read somewhere about how to improve upon the MVC pattern
A while back a found a great-looking framework that allowed .net developers to implement
A while back, smart clients had been touted as the solution to occasional connected
A while back I wrote a simple python program to brute-force the single solution

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.