From 745876c7360741b89200bc9b853f66993abfdab0 Mon Sep 17 00:00:00 2001 From: Karl Southern Date: Sat, 9 Aug 2014 14:12:20 +0100 Subject: [PATCH] Update README.md --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6cf85c7..37067fe 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,11 @@ This has not yet been extensively tested with all JDBC drivers and may not yet w ## Configuration options * driver_class, string, JDBC driver class to load * connection_string, string, JDBC connection string - * statement, array, an array of strings representing the SQL statement to run. Index 0 is the SQL statement that is prepared, all other array entries are passed in as parameters (in order). See example configurations below. + * statement, array, an array of strings representing the SQL statement to run. Index 0 is the SQL statement that is prepared, all other array entries are passed in as parameters (in order). A parameter may either be a property of the event (i.e. "@timestamp", or "host") or a formatted string (i.e. "%{host} - %{message}" or "%{message}"). If a key is passed then it will be automatically converted as required for insertion into SQL. If it's a formatted string then it will be passed in verbatim. * flush_size, number, default = 1000, number of entries to buffer before sending to SQL - * idle_flush_time, number, default = 1, number of idle seconds before sending data to SQL, even if the flush_size has not been reached + * idle_flush_time, number, default = 1, number of idle seconds before sending data to SQL, even if the flush_size has not been reached. If you modify this value you should also consider altering max_repeat_exceptions_time + * max_repeat_exceptions, number, default = 5, number of times the same exception can repeat before we stop logstash. Set to a value less than 1 if you never want it to stop + * max_repeat_exceptions_time, number, default = 30, maxium number of seconds between exceptions before they're considered "different" exceptions. If you modify idle_flush_time you should consider this value ## Example configurations ### SQLite3 @@ -33,7 +35,7 @@ output { jdbc { driver_class => 'org.sqlite.JDBC' connection_string => 'jdbc:sqlite:test.db' - statement => [ "INSERT INTO log (host, timestamp, message) VALUES(?, ?, ?)", "%{host}", "%{@timestamp}", "%{message}" ] + statement => [ "INSERT INTO log (host, timestamp, message) VALUES(?, ?, ?)", "host", "@timestamp", "message" ] } } ``` @@ -49,7 +51,7 @@ output { jdbc { driver_class => 'com.microsoft.sqlserver.jdbc.SQLServerDriver' 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}" ] + statement => [ "INSERT INTO log (host, timestamp, message) VALUES(?, ?, ?)", "host", "@timestamp", "message" ] } } ```