The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Import domlogs into mysql database

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

  1. olivermcgee_webmaster

    Joined:
    Jul 1, 2015
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    USA
    cPanel Access Level:
    Root Administrator
    Hello,

    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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    654
    Trophy Points:
    113
    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.
     
Loading...

Share This Page