Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Import domlogs into mysql database

Discussion in 'Database Discussion' started by olivermcgee_webmaster, Jul 1, 2015.

  1. olivermcgee_webmaster

    olivermcgee_webmaster Registered

    Jul 1, 2015
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator

    I have been searching for weeks for a solution to find a way to use some statistic data on our website. I have explored options using various tools like awstats, webalize, ect. Nothing i have found online or tried seams to be a viable solution. After much trial and error i think that the most stable solution that will remain usable through all current and future versions of cpanel will be to analyze data parsed from the domlogs but im struggling with finding the best way to do this.

    What i think might be the best way for me to access this data with the potential to have the most versatility in php is to import the access logs from /usr/local/apache/domlogs/%USER%/%VHOST% into a mysql database so that i can query the database for the information i need. I am open to suggestion if anyone has a better solution though.

    Let me tell you what my immediate need is and tell me your thoughts on how i could accomplish this.

    I have functions in my site that are gathering page views, storing them in the sites database and allows me to publish the view count overall and on a per page basis. Works great but my end user wants to also dynamically update an overall "Hits" statistic on the site. (I cant talk him out of it no matter how hard i try) what i found is that i can grep the domlog for a total count of the 200 response code to get the statistic i want to use. So if i can figure out how to dump the log to mysql i can write a function to get the sumcount and i wont have to worry about the log rotation effecting this functions ability to dynamically publish the statistic.

    Any help anyone can offer is welcome.
    Thoughts? Suggestions? Solutions?
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Apr 11, 2011
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    Hello :)

    You may receive more user-feedback on this type of custom script at a website such as StackOverflow. Feel free to update this thread with any solutions you find.

    Thank you.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice