# Several tables in from

**URL:** <https://discuss.elastic.co/t/several-tables-in-from/123105>\
**Category:** Logstash\
**Created:** [March 8, 2018, 3:14pm UTC](https://discuss.elastic.co/t/several-tables-in-from/123105 "2018-03-08T15:14:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amandine](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amandine/32/28305_2.png) [@Amandine](https://discuss.elastic.co/u/Amandine)\
**Post date:** [March 8, 2018, 3:14pm UTC](https://discuss.elastic.co/t/several-tables-in-from/123105/1 "2018-03-08T15:14:25Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [March 8, 2018, 7:27pm UTC](https://discuss.elastic.co/t/several-tables-in-from/123105/2 "2018-03-08T19:27:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Amandine](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amandine/32/28305_2.png) [@Amandine](https://discuss.elastic.co/u/Amandine)\
**Post date:** [March 8, 2018, 9:04pm UTC](https://discuss.elastic.co/t/several-tables-in-from/123105/3 "2018-03-08T21:04:46Z")

</div>

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"  
> }  
> }

---

<div class="post-metadata">

**Author:** ![pjanzen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pjanzen/32/13756_2.png) [@pjanzen](https://discuss.elastic.co/u/pjanzen)\
**Post date:** [March 8, 2018, 10:39pm UTC](https://discuss.elastic.co/t/several-tables-in-from/123105/4 "2018-03-08T22:39:37Z")

</div>

According to the docs [Jdbc input plugin](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html) 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.

---

<div class="post-metadata">

**Author:** ![Amandine](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amandine/32/28305_2.png) [@Amandine](https://discuss.elastic.co/u/Amandine)\
**Post date:** [March 9, 2018, 8:47am UTC](https://discuss.elastic.co/t/several-tables-in-from/123105/5 "2018-03-09T08:47:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 6, 2018, 8:48am UTC](https://discuss.elastic.co/t/several-tables-in-from/123105/6 "2018-04-06T08:48:01Z")

</div>

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