forked from theangryangel/logstash-output-jdbc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move examples and split up connection code
Bump version
- Loading branch information
1 parent
529c98a
commit ae51d77
Showing
11 changed files
with
158 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Example: Apache Phoenix (HBase SQL) | ||
* Tested with Ubuntu 14.04.03 / Logstash 2.1 / Apache Phoenix 4.6 | ||
* <!> HBase and Zookeeper must be both accessible from logstash machine <!> | ||
``` | ||
input | ||
{ | ||
stdin { } | ||
} | ||
output { | ||
jdbc { | ||
connection_string => "jdbc:phoenix:ZOOKEEPER_HOSTNAME" | ||
statement => [ "UPSERT INTO EVENTS log (host, timestamp, message) VALUES(?, ?, ?)", "host", "@timestamp", "message" ] | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Example: MariaDB | ||
* Tested with Ubuntu 14.04.3 LTS, Server version: 10.1.9-MariaDB-1~trusty-log mariadb.org binary distribution | ||
* Tested using https://downloads.mariadb.com/enterprise/tqge-whfa/connectors/java/connector-java-1.3.2/mariadb-java-client-1.3.2.jar (mariadb-java-client-1.3.2.jar) | ||
``` | ||
input | ||
{ | ||
stdin { } | ||
} | ||
output { | ||
jdbc { | ||
connection_string => "jdbc:mariadb://HOSTNAME/DATABASE?user=USER&password=PASSWORD" | ||
statement => [ "INSERT INTO log (host, timestamp, message) VALUES(?, ?, ?)", "host", "@timestamp", "message" ] | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# 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 { | ||
connection_string => "jdbc:mysql://HOSTNAME/DATABASE?user=USER&password=PASSWORD" | ||
statement => [ "INSERT INTO log (host, timestamp, message) VALUES(?, CAST (? AS timestamp), ?)", "host", "@timestamp", "message" ] | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Example: ODPS | ||
With thanks to [@onesuper](https://github.com/onesuper) | ||
``` | ||
input | ||
{ | ||
stdin { } | ||
} | ||
output { | ||
jdbc { | ||
driver_class => "com.aliyun.odps.jdbc.OdpsDriver" | ||
driver_auto_commit => false | ||
connection_string => "jdbc:odps:http://service.odps.aliyun.com/api?project=meta_dev&loglevel=DEBUG" | ||
username => "abcd" | ||
password => "1234" | ||
max_pool_size => 5 | ||
flush_size => 10 | ||
statement => [ "INSERT INTO test_logstash VALUES(?, ?, ?);", "host", "@timestamp", "message" ] | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Example: Oracle | ||
With thanks to [@josemazo](https://github.com/josemazo) | ||
* Tested with Express Edition 11g Release 2 | ||
* Tested using http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-112010-090769.html (ojdbc6.jar) | ||
``` | ||
input | ||
{ | ||
stdin { } | ||
} | ||
output { | ||
jdbc { | ||
connection_string => "jdbc:oracle:thin:USER/PASS@HOST:PORT:SID" | ||
statement => [ "INSERT INTO log (host, timestamp, message) VALUES(?, CAST (? AS timestamp), ?)", "host", "@timestamp", "message" ] | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Example: Postgres | ||
With thanks to [@roflmao](https://github.com/roflmao) | ||
``` | ||
input | ||
{ | ||
stdin { } | ||
} | ||
output { | ||
jdbc { | ||
connection_string => 'jdbc:postgresql://hostname:5432/database?user=username&password=password' | ||
statement => [ "INSERT INTO log (host, timestamp, message) VALUES(?, CAST (? AS timestamp), ?)", "host", "@timestamp", "message" ] | ||
} | ||
} | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Example: SQL Server | ||
* Tested using http://msdn.microsoft.com/en-gb/sqlserver/aa937724.aspx | ||
``` | ||
input | ||
{ | ||
stdin { } | ||
} | ||
output { | ||
jdbc { | ||
connection_string => "jdbc:sqlserver://server:1433;databaseName=databasename;user=username;password=password;autoReconnect=true;" | ||
statement => [ "INSERT INTO log (host, timestamp, message) VALUES(?, ?, ?)", "host", "@timestamp", "message" ] | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Example: SQLite3 | ||
* Tested using https://bitbucket.org/xerial/sqlite-jdbc | ||
* SQLite setup - `echo "CREATE table log (host text, timestamp datetime, message text);" | sqlite3 test.db` | ||
``` | ||
input | ||
{ | ||
stdin { } | ||
} | ||
output { | ||
stdout { } | ||
jdbc { | ||
connection_string => 'jdbc:sqlite:test.db' | ||
statement => [ "INSERT INTO log (host, timestamp, message) VALUES(?, ?, ?)", "host", "@timestamp", "message" ] | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters