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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:16:11+00:00 2026-05-27T06:16:11+00:00

When I review logs on a server I want to have a quick overview

  • 0

When I review logs on a server I want to have a quick overview of the type of problems that I’m facing before I got digging deeper. I usually use the below one-liner which reduces the number of log lines I need to review by making each line more generic and keeping only the ones that are unique.

One-liner

cat /var/log/apache2/error.log | sed 's/.*] \(.*\)/\1/' | sed 's/[0-9]*//g' | sort | uniq

Explanation

| sed 's/.*] \(.*\)/\1/': removes everything contained within and before the last bracket group which typically corresponds to client/system-specific info such as [Mon Dec 05 12:01:03 2011] [error] [client a.b.c.d]

| sed 's/[0-9]*//g': removes numbers

| sort | uniq: only keeps lines that are different.

To give you an idea, on an /var/log/apache2/error.log that contains around 500 lines, this filters out to 25 lines. Off course the more generic/similar the log entries, the more the one-liner is effective.

What I’m looking for now is a script (could be bash,perl,python or anything else actually) that could do the same thing but a bit more advanced so as to be even more effective (e.g. obfuscate file paths, alphabetical ids…) and useful (count how many occurrences of each message, % compared to the overall amount of logs…).

Do you know scripts that do that?

  • 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-27T06:16:12+00:00Added an answer on May 27, 2026 at 6:16 am

    have a look at logwatch . it does send you a daily overview of common logfiles. I have only used it for mail logs so far but afaik it can handle apache logs as well.

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

Sidebar

Related Questions

I have a database that logs when an employee has attended a course and
I want to have only review from this JSON. var json = { provider:
We have a jquery/php/mysql system that allows a user to log in and review
Please review the example code below, I have a class file that is loaded
Im writing a review site where the community rates posts. I have noticed that
After a review of the iPhone SDK documentation, I have not yet found a
In my Review model, I have the following: class Review < ActiveRecord::Base belongs_to :vendor
I'm doing code review and came across a class that uses all static methods.
I have a Review Model like the one defined below (I removed a bunch
I want to customize the review summary block on the product page, but I

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.