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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T15:51:18+00:00 2026-05-21T15:51:18+00:00

I want to make a log parser for for an Asterisk PBX, but don’t

  • 0

I want to make a log parser for for an Asterisk PBX, but don’t know where to start.
I figured it out what i need from the log. the lines that i need look like this:
[Apr 12 11:11:56] VERBOSE[3359] logger.c: -- Called 111
the number in VERBOSE[….] are the same for 1 call.

The first thing that i have to do is get the lines that contain that VERBOSE number so i can identify that call. the second thing is to read the text, there are some standard texts so it won’t be hard to recognize.

The thing is that i would like to read it real time (the file is written real time), and display it in a webpage. PHP or Ajax.

The thing that i want to do is, show up rows in a webpage as users call. and the new call to be added under the current/answered call.

Any tips, examples would be great.

Thanks,
Sebastian

  • 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-21T15:51:19+00:00Added an answer on May 21, 2026 at 3:51 pm

    I would do it in 2 programs that can work as simple CGI programs.

    1. First program parses log and show date and call identifier. Such identifier will be link to 2nd program. In Python you can use regexp:

      # 1st group - date, 2nd - callid
      RX_VERBOSE =  re.compile(r'(.*) VERBOSE\[(\d+)\] ')
      
      def make_link(call_id):
          return(' <a href="show_call.cgi?call_id=%d>%d</a>' % (call_id, call_id))
      
      def show_calls(logfn):
          call_ids = []
          f = open(logfn)
          for line in f:
              rx = RX_VERBOSE.search(line)
              if rx:
                  call_id = int(rx.group(2))
                  if not call_id in call_ids:
                      print('%s %s' % (rx.group(1), make_link(call_id)))
                      call_ids.append(call_id)
          f.close()
      
    2. This program will show the lines that has call identifier:

      def show_call_datails(logfn, call_id):
          search_str = ' VERBOSE[%s] ' % call_id
          f = open(logfn)
          for line in f:
              if search_str in line:
                  print(line.rstrip())
          f.close()
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to make a iis log viewer for websites I develop. I know
dear developer i want make an image from an offscreen view. when i start
I want to make an entity that has an autogenerated primary key, but also
I want to make an entry in the log if my servlet throws ServletException
I want to make a link from this page navigate to a details page
I want to make call log in j2me. I had tried this wiki information.
I want to make a log function in ASP and to do that I
I'm currently trying to make Log4J log into a JTextPane . I want to
I didn't want to make the title too long but this question specifically refers
i have a TCP server which receives requests from clients. i want to make

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.