2

I am interested in storing every nginx access log into a mysql table instead of the text file.

I need this so I can perform actions on the access log.

How would I go about doing this.

Is this even possible?

Thank you!

blue ice
  • 173
  • 1
  • 3
  • 9
  • 1
    [Log to syslog](http://nginx.org/en/docs/syslog.html) and there are many ways to use mysql as syslog's storage. – Alexey Ten Jun 26 '15 at 10:11
  • See answer here http://stackoverflow.com/questions/30191227/log-visits-in-shared-memory/30199356#30199356 – itpp13 Jun 26 '15 at 21:27

2 Answers2

1

You may look at Rsyslog It's an open-source software utility for forwarding log messages to database, Take a look at this link: High-performance logging from Nginx to Postgres with Rsyslog

Hadi Rasekh
  • 2,622
  • 2
  • 20
  • 28
0

I'm interested in this too. If I don’t find a good solution, I just write a little PHP file to act as middleware and come back and post it here.

Not ideal, but better than nothing.

Edit: You've been waiting 3 years, so I hope 1 more weekend won't kill you

Luke Mlsna
  • 468
  • 4
  • 16
  • Then what are you going to do with the data? I thought about doing something like this but upon further investigation there are loads of really good open source solutions for extracting data from server logfiles and displaying stats, drawing graphs etc so I didnt bother – miknik Jul 07 '18 at 17:43