Search code examples
elasticsearchlogstashlogstash-configurationlogstash-jdbc

Is it possible to use a varchar/string for jdbc sql_last_value?


I've already tested the sql_last_value with an integer and datetime type of fields in my jdbc plugin within the logstash input and it's working perfectly.

I'm just curios, is there any possibility of using a varchar/string type of field, in order to update the sql_last_value time to time in case if there aren't any datetime or int field in my table.

Any help could be appreciated.


Solution

  • The answer is no. As a proof you can look at the source code for the jdbc input plugin.

    The declaration of the tracking_column_type field highlights the following:

      # Type of tracking column. Currently only "numeric" and "timestamp"
      config :tracking_column_type, :validate => ['numeric', 'timestamp'], :default => 'numeric'
    

    This means that this field will only be allowed to contain two values, namely timestamp and numeric.