Insert Nginx Access Logs Into MySQL Database

5.2k views Asked by At

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!

2

There are 2 answers

1
Luke Mlsna On

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

0
Hadi Rasekh On

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