allinurl/goaccess — pull request #19 by abgit (2013-08-23 11:30:27+00:00)
Title: export feature: csv (for mysql or other db)

Hello all,
Some times we need to store parsing values for processing.
Because we need a structured format for values, i created a simple way to export values as CSV. My first thought was to develop a driver inside goaccess so that it inserts values inside mysql but a CSV is a much better option and as more advantages:
* compatible with mysql and other databases (postgresql, oracle, sqlserver);
* don't consume so much memory as a mysql driver;
* more effective. exporting huge file and import with mysql load data is much faster than custom C inserts;
* mysql load data local infile is optimized from years;

How to use:

1. just define csv format in command line:
```goaccess -f access.log -o csv > output.csv```
2. mysql: create a simple table with 6 columns:
```CREATE TABLE `mytable` (
`ref` varchar(10)
`v1` varchar(25)
`v2` varchar(25)
`v3` varchar(250)
`v4` varchar(25)
`v5` varchar(300)
)```
3. import values:
```mysql load data local infile '/myfolder/output.csv' into table mydatabase.mytable fields terminated by ',' lines terminated by '\n';
```

With this new feature we can process information easily.
What do you think?

best,