2015-12-30 12:04:23 +00:00
|
|
|
# Example: Mysql
|
|
|
|
With thanks to [@jMonsinjon](https://github.com/jMonsinjon)
|
|
|
|
* Tested with Version 14.14 Distrib 5.5.43, for debian-linux-gnu (x86_64)
|
|
|
|
* Tested using http://dev.mysql.com/downloads/file.php?id=457911 (mysql-connector-java-5.1.36-bin.jar)
|
|
|
|
```
|
|
|
|
input
|
|
|
|
{
|
|
|
|
stdin { }
|
|
|
|
}
|
|
|
|
output {
|
|
|
|
jdbc {
|
2016-05-03 16:11:28 +00:00
|
|
|
driver_class => "com.mysql.jdbc.Driver"
|
2015-12-30 12:04:23 +00:00
|
|
|
connection_string => "jdbc:mysql://HOSTNAME/DATABASE?user=USER&password=PASSWORD"
|
2016-05-03 14:28:01 +00:00
|
|
|
statement => [ "INSERT INTO log (host, timestamp, message) VALUES(?, CAST(? AS timestamp), ?)", "host", "@timestamp", "message" ]
|
2015-12-30 12:04:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|