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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:58:08+00:00 2026-06-13T03:58:08+00:00

I have a large log of authentication between various networks that I need to

  • 0

I have a large log of authentication between various networks that I need to summarize.

First I run

SELECT Home, Con, COUNT(*) AS 'ACCEPTS' FROM AUTHLOG WHERE response='ACCEPT';

Which gives me the summary:

+------+------+---------+
| Home | Con  | ACCEPTS |
+------+------+---------+
| net1 | net1 |      37 |
| net1 | net2 |       2 |
| net1 | net3 |     578 |
| net2 | net1 |      56 |
| net2 | net2 |   95621 |
| net2 | net3 |     465 |
| net3 | net1 |      91 |
| net3 | net2 |      83 |
| net3 | net3 |     891 |
+------+------+---------+

I need to start storing these results in a separate table, accumulating the total ACCEPTS (since the AUTHLOG table gets truncated).

The seperate summary table is very simple:

CREATE TABLE ACCEPTS_SUMMARY (
   Home char(50) DEFAULT NULL,
   Con char(50) DEFAULT NULL,
   Accepts INT UNSIGNED DEFAULT 0
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

Is there a way, within MySQL preferably (no Python or Perl on the host, a bash script could work though), that I could get the above counts, and add them to the existing totals in a summary table, or insert if the Home and Con combination doesn’t already exist.

  • 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-13T03:58:08+00:00Added an answer on June 13, 2026 at 3:58 am

    This should do the trick:

    INSERT INTO summary(Home, Con, ACCEPTS)
    SELECT Home, Con, COUNT(*)
    FROM AUTHLOG
    WHERE response='ACCEPT'
    ON DUPLICATE KEY UPDATE ACCEPTS = ACCEPTS + VALUES(ACCEPTS)
    

    Make sure table summary has a UNIQUE INDEX on (Home, Con).

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

Sidebar

Related Questions

I have a large amount of log data that I need to get some
I have a large set of log entries that I need to do an
I currently have a large set of ASMX web services that log the incoming
I have large log files which contains timestamps every one second.what I need is
I have a large set of log files that I want to characterize or
I have a few very large log files, and I need to parse them.
i have large numbers of text files and i am in problem that i
I have large video files (~100GB) that are local on my machine. I have
We have a crawler that persistently crawls our target sites, it's log files are
I have a moderately large piece (a few thousand lines) of Python/Numpy/Scipy code that

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.