# Logstash intermittently fails to start using jdbc-static filter

**URL:** <https://discuss.elastic.co/t/logstash-intermittently-fails-to-start-using-jdbc-static-filter/247575>\
**Category:** Logstash\
**Created:** [September 4, 2020, 4:08pm UTC](https://discuss.elastic.co/t/logstash-intermittently-fails-to-start-using-jdbc-static-filter/247575 "2020-09-04T16:08:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paal\_Aaserud](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paal_aaserud/32/75137_2.png) [@Paal\_Aaserud](https://discuss.elastic.co/u/Paal_Aaserud)\
**Post date:** [September 4, 2020, 4:08pm UTC](https://discuss.elastic.co/t/logstash-intermittently-fails-to-start-using-jdbc-static-filter/247575/1 "2020-09-04T16:08:11Z")

</div>

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

---

<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:** [October 2, 2020, 4:08pm UTC](https://discuss.elastic.co/t/logstash-intermittently-fails-to-start-using-jdbc-static-filter/247575/2 "2020-10-02T16:08:13Z")

</div>

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