Skip to content
This repository was archived by the owner on Sep 17, 2019. It is now read-only.

Commit 529c98a

Browse files
committed
Addresses 22 not giving warning about incorrectly configured statements
1 parent bfcd9bf commit 529c98a

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,17 @@ particular location. Please ensure you read the 4 installation lines below.
1717
- Altered exception handling to now count sequential flushes with exceptions thrown in 0.2.0
1818

1919
## Versions
20+
Released versions are are tagged as of v0.2.1, and available via rubygems.
21+
22+
For development:
2023
- See master branch for logstash v2+
2124
- See v1.5 branch for logstash v1.5
2225
- See v1.4 branch for logstash 1.4
2326

2427
## Installation
2528
- Run `bin/plugin install logstash-output-jdbc` in your logstash installation directory
2629
- Now either:
27-
- Use driver_class in your configuraton to specify a path to your jar file
30+
- Use driver_path in your configuraton to specify a path to your jar file
2831
- Or:
2932
- Create the directory vendor/jar/jdbc in your logstash installation (`mkdir -p vendor/jar/jdbc/`)
3033
- Add JDBC jar files to vendor/jar/jdbc in your logstash installation

lib/logstash/outputs/jdbc.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,14 @@ def register
102102
@logger.warn("JDBC - Flush size is set to > 1000")
103103
end
104104

105+
if @statement.length < 1
106+
@logger.error("JDBC - No statement provided. Configuration error.")
107+
end
108+
109+
if (!@unsafe_statement and @statement.length < 2)
110+
@logger.error("JDBC - Statement has no parameters. No events will be inserted into SQL as you're not passing any event data. Likely configuration error.")
111+
end
112+
105113
buffer_initialize(
106114
:max_items => @flush_size,
107115
:max_interval => @idle_flush_time,

0 commit comments

Comments
 (0)