Several tables in from

(Lethuillier) #1

Hello, I have a JDBC driver with SQL Server ELK ... I have an error message with a syntax problem with the FROM when doing a ./logstash -f /etc/logstash/conf.d/file.conf. I want to add several tables in the same FROM. There are inner joins to link the tables. Is it possible ? Or should I make an input for a table?

(Magnus B├Ąck) #2

Logstash doesn't care about what your SQL statement looks like. It's up to the underlying database and possibly the JDBC driver.

(Lethuillier) #3

Yes. But why I have an error of syntaxe from "FROM". Can I create a file .sql with my request ?

input {
jdbc {
statement => "file.sql"

(Pjanzen) #4

According to the docs Jdbc input plugin you can create a sql file which contains the query and load it into the input with statement_filepath => 'full path to sql file'

If you are getting a syntax error on FROM you should create a test your query separately from this input as combining the the 2 adds to the complexity.

I do not know what type of DB you are connecting to with jdbc but generally databases support join's so that should be doable in you sql statement.

(Lethuillier) #5

I do not know what type and my database. I tried the statement_filepath and it seems to work. Thank you.

(system) #6

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.