# Logstash Error to read SQL query for Firebird

**URL:** <https://discuss.elastic.co/t/logstash-error-to-read-sql-query-for-firebird/218388>\
**Category:** Logstash\
**Created:** [February 7, 2020, 5:27pm UTC](https://discuss.elastic.co/t/logstash-error-to-read-sql-query-for-firebird/218388 "2020-02-07T17:27:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![eng.lucianamendes](https://avatars.discourse-cdn.com/v4/letter/e/cdc98d/32.png) [@eng.lucianamendes](https://discuss.elastic.co/u/eng.lucianamendes)\
**Post date:** [February 7, 2020, 5:27pm UTC](https://discuss.elastic.co/t/logstash-error-to-read-sql-query-for-firebird/218388/1 "2020-02-07T17:27:31Z")

</div>

I´m using Logstash in Raspiberry Pi with OS Raspbian Jesse. It´s works with API, but it don't works with a Firebird.  
The error is :  
[2020-02-07T14:43:11,666][ERROR][logstash.inputs.jdbc] Java::JavaSql::SQLSyntaxErrorException: Dynamic SQL Error; SQL error code = -104; Token unknown - line 1, column 93; LIMIT [SQLState:42000, ISC error code:335544634]: SELECT count(\*) AS "COUNT" FROM (SELECT \* FROM SP\_EFICIENCIA\_MENSAL\_FABRICACAO('')) AS "T1" LIMIT 1

My file .conf is:

input{  
jdbc{  
jdbc\_driver\_library =\> "/usr/share/logstash/bin/jaybird-full-3.0.8.jar"  
jdbc\_driver\_class =\> "org.firebirdsql.jdbc.FBDriver"  
jdbc\_connection\_string =\> "jdbc:firebirdsql:IP\_Adress:C:\X\XXX\my\_data\_base.FDB"  
jdbc\_user =\> "my-user"  
jdbc\_password =\> "my-passord"  
schedule =\> "\* \* \* \* \*"  
statement =\> "SELECT \* FROM SP\_EFICIENCIA\_MENSAL\_FABRICACAO('')"   
jdbc\_page\_size =\> 0   
jdbc\_paging\_enabled =\> false  
clean\_run =\> "true"  
last\_run\_metadata\_path =\> "/usr/share/logstash/bin/lat\_run.txt"  
}  
}  
output{  
elasticsearch{  
hosts =\> "my-cloud:9200"  
index =\> "my-index"  
document\_id =\> "%{id}"  
}  
}

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [February 7, 2020, 6:04pm UTC](https://discuss.elastic.co/t/logstash-error-to-read-sql-query-for-firebird/218388/2 "2020-02-07T18:04:56Z")

</div>

The jdbc input [attempts](https://github.com/logstash-plugins/logstash-input-jdbc/blob/ae2523b5810eca7c5aa0a19b8677b49b643318fb/lib/logstash/plugin_mixins/jdbc/checked_count_logger.rb#L27) to count the number of rows that the query will return. When it does that it appends "LIMIT 1" to the query. However, Firebird uses a different syntax (FIRST 1). That should result in a single error message and the count feature being disabled. In other words, you should be able to ignore this.

---

<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:** [March 6, 2020, 6:04pm UTC](https://discuss.elastic.co/t/logstash-error-to-read-sql-query-for-firebird/218388/3 "2020-03-06T18:04:57Z")

</div>

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