Logstash intermittently fails to start using jdbc-static filter

Environment:

  • Red Hat Enterprise Linux release 8.2 (Ootpa)
  • Logstash 7.9.0

I have configured logstash 7.9 with a multiple pipeline using the jdbc_static filter to fill two local db's for enrichment. Some times starting up as a service or from the command-line in linux, it fails to start complaining about the error below.

Error:
[2020-08-21T13:04:53,414][ERROR][logstash.javapipeline ][vegloggenlog] Pipeline aborted due to error {:pipeline_id=>"vegloggenlog", :exception=>#<LogStash::Filters::Jdbc::LoaderJdbcException: Exception when filling lookup db from loader fylke, query results, original exception: Sequel::DatabaseError, original message: Java::JavaSql::SQLException: Import error on line 1 of file /tmp/logstash/jdbc_static/import_data/fylke: Data file not found: /tmp/logstash/jdbc_static/import_data/fylke >

Conf:

filter {   
      jdbc_static {
        jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"
    	jdbc_driver_library => "C:\DATA\ELK\JDBC\ojdbc7.jar"
        jdbc_connection_string => "jdbc:oracle:thin:@SID"
        jdbc_user => "user"
        jdbc_password => "pass"    
    	loaders => [
          {
            id => "kontrakt"
            query => "select i.incident_id, c.contractareaname navn, decode(length(trim(translate(substr(c.contractareaname,1,4), ' +-.0123456789',' '))),null,substr(c.contractareaname,1,4),null) nummer
    				from contractareas c 
    				inner join incident_ca ic on ic.contract_id = c.id
    				left join incident i on ic.incident_id = i.incident_id
    			where i.updateddate > TO_DATE ('01.06.2019', 'dd.mm.yyyy')"
            local_table => "kontrakt"
          },
    	  {
        id => "fylke"
        query => "select distinct to_number(incident_id) incident_id, to_number(nummer) from incident
					unpivot
					( nummer for fylke in (fromcounty, tocounty) )
					where updateddate > TO_DATE ('01.06.2019', 'dd.mm.yyyy')"
        local_table => "fylke"
      }
    ]
    local_db_objects => [
      {
        name => "kontrakt"
        index_columns => ["incident_id"]
        columns => [
          ["incident_id", "bigint"],
          ["navn", "varchar(255)"],
          ["nummer", "varchar(50)"]
         ]
      },
	  {
        name => "fylke"
        index_columns => ["incident_id"]
        columns => [
          ["incident_id", "bigint"],
          ["nummer", "int"]
         ]
      }
    ]
    local_lookups => [
      {
        query => "select nummer, navn from kontrakt WHERE incident_id = :id"
        parameters => {id => "[hendelseid]"}
        target => "kontrakt"
      },
	  {
        query => "select nummer from fylke WHERE incident_id = :id"
        parameters => {id => "[hendelseid]"}
        target => "fylke"
      }
    ]
  }

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