Author Topic: [SOLVED]How to export HTTP Proxy logs  (Read 2572 times)

sheshman

  • Zen Apprentice
  • *
  • Posts: 34
  • Karma: +1/-0
    • View Profile
[SOLVED]How to export HTTP Proxy logs
« on: September 15, 2014, 07:59:09 am »
Hello Everyone,

Zentyal is really good system but one of the needs is export the logs as excel,pdf or so on. In my country goverment pushes the companys to log users http traffic, under Maintenance-Logs you can see the user's activitys but somehow there is no export button or option, is anybody know how i can export logs to excel or pdf without copy & paste each page ? I searched on forum and found the exact same question and answer here "https://forum.zentyal.org/index.php?topic=1014.0" but commands in that answer is not working, i believe Zentyal is keeping that logs in a database (Mysql or Postresql etc.) if i'm right is anybody knows how i can reach to that database or log files ?

Thanks in advance.
« Last Edit: September 16, 2014, 12:06:46 pm by sheshman »

jbahillo

  • Zentyal Staff
  • Zen Hero
  • *****
  • Posts: 1444
  • Karma: +77/-2
    • View Profile
Re: How to export HTTP Proxy logs
« Reply #1 on: September 15, 2014, 10:04:16 am »
Hello:

Zentyal 3.x and upper stores logs on mysql. The post you point to refer to Zentyal 2.x where postgres was being used.

So in order to access the database you will need to use mysql. You can find root passwd for mysql on /var/lib/zentyal/conf/zentyal-mysql.passwd.

You will need to point to zentyal database and look for in the rows of table squid_access


sheshman

  • Zen Apprentice
  • *
  • Posts: 34
  • Karma: +1/-0
    • View Profile
Re: How to export HTTP Proxy logs
« Reply #2 on: September 16, 2014, 10:39:47 am »
@jbahillo thanks for reply, i found the MySQL password, but however i culdn't connect via my computer (with MySQL management software via 3306 port) i think MySQL server is not configured as to reach from network, to fix that problem i've tried to install phpmyadmin under to /var/www/html folder but when i try to create a new folder system says permision denied, when i check the folder permissions it belongs to root but somehow i couldn't change that too. I need to reach to MySQL server via network, so i'm stuck here :) Requesting backup :)

sheshman

  • Zen Apprentice
  • *
  • Posts: 34
  • Karma: +1/-0
    • View Profile
Re: How to export HTTP Proxy logs
« Reply #3 on: September 16, 2014, 11:25:10 am »
i fixed the MySQL Connection problem, writing down the solution if anybody needs like me in the future;

1-) open the terminal as root
2-) cd /etc/mysql
3-) nano my.cnf
4-) find the line bind-address = 127.0.0.1 and add # to beginning (comment it out), it should be like : #bind-address = 127.0.0.1
5-) save and exit from nano
6-) service mysql stop
7-) service mysql start

and now you can connect via network :)

jbahillo

  • Zentyal Staff
  • Zen Hero
  • *****
  • Posts: 1444
  • Karma: +77/-2
    • View Profile
Re: How to export HTTP Proxy logs
« Reply #4 on: September 16, 2014, 11:32:07 am »
Moreover you can use mysql CLI,  and use select into outfile (widely documentated on Internet) in order to dump table contents into a csv