Jdbc: using statement_filepath together with sql_last_value

I want to use the jdbc plugin to sync data from MySQL to Elasticsearch. The MySQL query is quite long so I chose to put it in an external SQL file using the 'statement_filepath' option in the Logstash config file.

Now I want to use the predefined parameter "sql_last_value" in this SQL file but this is throwing an error. I cannot find any documentation if this can be used together or if I have to put the whole SQL statement into the Logstash config file using the 'statement' option.

The SQL looks something like this:

...
WHERE updated_at > :sql_last_start
...

The error I get is:

Exception when executing JDBC query {:exception=>#<Sequel::DatabaseError: Java::ComMysqlJdbcExceptionsJdbc4::MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':sql_last_start

Thankful for any feedback!

Alex

Hello Alex,

I have the same issue, do you already found a solution?

Thanks,
Hervé

Yes!

Can you share?

Sure, sorry. It was my mistake. I used sql_last_start instead of sql_last_value.

Ok, well received.