You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 17, 2019. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+16-16Lines changed: 16 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,8 +12,9 @@ This plugin does not bundle any JDBC jar files, and does expect them to be in a
12
12
particular location. Please ensure you read the 4 installation lines below.
13
13
14
14
## Headlines
15
-
- Support for connection pooling added in 0.2.0 [unreleased until #21 is resolved]
16
-
- Support for unsafe statement handling (allowing dynamic queries) in 0.2.0 [unreleased until #21 is resolved]
15
+
- Support for connection pooling added in 0.2.0 [unreleased until #10 is resolved]
16
+
- Support for unsafe statement handling (allowing dynamic queries) in 0.2.0 [unreleased until #10 is resolved]
17
+
- Altered exception handling to now count sequential flushes with exceptions thrown in 0.2.0 [untested and unreleased until #10 is resolved]
17
18
18
19
## Versions
19
20
- See master branch for logstash v2+
@@ -31,20 +32,19 @@ particular location. Please ensure you read the 4 installation lines below.
31
32
32
33
## Configuration options
33
34
34
-
| Option | Type | Description | Required? |
35
-
| ------ | ---- | ----------- | --------- |
36
-
| driver_path | String | File path to jar file containing your JDBC driver. This is optional, and all JDBC jars may be placed in $LOGSTASH_HOME/vendor/jar/jdbc instead. | No |
| username | String | JDBC username - this is optional as it may be included in the connection string, for many drivers | No |
39
-
| password | String | JDBC password - this is optional as it may be included in the connection string, for many drivers | No |
40
-
| 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. | Yes |
41
-
| unsafe_statement | Boolean | If yes, the statement is evaluated for event fields - this allows you to use dynamic table names, etc. **This is highly dangerous** and you should **not** use this unless you are 100% sure that the field(s) you are passing in are 100% safe. Failure to do so will result in possible SQL injections. Please be aware that there is also a potential performance penalty as each event must be evaluated and inserted into SQL one at a time, where as when this is false multiple events are inserted at once. Example statement: [ "insert into %{table_name_field} (column) values(?)", "fieldname" ]| No |
42
-
| max_pool_size | Number | Maximum number of connections to open to the SQL server at any 1 time | No |
43
-
| connection_timeout | Number | Number of seconds before a SQL connection is closed | No |
44
-
| flush_size | Number | Maximum number of entries to buffer before sending to SQL - if this is reached before idle_flush_time | No |
45
-
| idle_flush_time | Number | Number of idle seconds before sending data to SQL - even if the flush_size has not yet been reached | No |
46
-
| max_repeat_exceptions | Number | 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 | No |
47
-
| max_repeat_exceptions_time | Number | Maxium number of seconds between exceptions before they're considered "different" exceptions. If you modify idle_flush_time you should consider this value | No |
| driver_path | String | File path to jar file containing your JDBC driver. This is optional, and all JDBC jars may be placed in $LOGSTASH_HOME/vendor/jar/jdbc instead. | No ||
| username | String | JDBC username - this is optional as it may be included in the connection string, for many drivers | No ||
40
+
| password | String | JDBC password - this is optional as it may be included in the connection string, for many drivers | No ||
41
+
| 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. | Yes ||
42
+
| unsafe_statement | Boolean | If yes, the statement is evaluated for event fields - this allows you to use dynamic table names, etc. **This is highly dangerous** and you should **not** use this unless you are 100% sure that the field(s) you are passing in are 100% safe. Failure to do so will result in possible SQL injections. Please be aware that there is also a potential performance penalty as each event must be evaluated and inserted into SQL one at a time, where as when this is false multiple events are inserted at once. Example statement: [ "insert into %{table_name_field} (column) values(?)", "fieldname" ]| No | False |
43
+
| max_pool_size | Number | Maximum number of connections to open to the SQL server at any 1 time | No | 5 |
44
+
| connection_timeout | Number | Number of seconds before a SQL connection is closed | No | 2800 |
45
+
| flush_size | Number | Maximum number of entries to buffer before sending to SQL - if this is reached before idle_flush_time | No | 1000 |
46
+
| idle_flush_time | Number | Number of idle seconds before sending data to SQL - even if the flush_size has not yet been reached | No | 1 |
47
+
| max_flush_exceptions | Number | Number of sequential flushes which cause an exception, before we stop logstash. Set to a value less than 1 if you never want it to stop. This should be carefully configured with relation to idle_flush_time if your SQL instance is not highly available. | No | 0 |
48
48
49
49
## Example configurations
50
50
If you have a working sample configuration, for a DB thats not listed, pull requests are welcome.
config:max_repeat_exceptions,:obsolete=>"This has been replaced by max_flush_exceptions - which behaves slightly differently. Please check the documentation."
75
+
config:max_repeat_exceptions_time,:obsolete=>"This is no longer required"
@logger.warn("JDBC - max_repeat_exceptions_time is set such that it may still permit a looping exception. You probably changed idle_flush_time. Considering increasing max_repeat_exceptions_time.")
@logger.error("JDBC - Exception repeated more than the maximum configured",:exception=>e,:max_repeat_exceptions=>@max_repeat_exceptions,:max_repeat_exceptions_time=>@max_repeat_exceptions_time)
Copy file name to clipboardExpand all lines: logstash-output-jdbc.gemspec
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
Gem::Specification.newdo |s|
2
2
s.name='logstash-output-jdbc'
3
-
s.version="0.2.0.rc3"
3
+
s.version="0.2.0.rc4"
4
4
s.licenses=["Apache License (2.0)"]
5
5
s.summary="This plugin allows you to output to SQL, via JDBC"
6
6
s.description="This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program"
@@ -24,4 +24,6 @@ Gem::Specification.new do |s|
24
24
s.add_runtime_dependency"logstash-codec-plain"
25
25
26
26
s.add_development_dependency"logstash-devutils"
27
+
28
+
s.post_install_message="logstash-output-jdbc 0.2.0 introduces several new features - please ensure you check the documentation in the README file"
0 commit comments