title: How to get more than one record?
body: <p>I am using JDBC with logstash to get data from a PostgreSQL query and export it to ES v7 here is the configuration file:</p>
  <pre><code>input {
      jdbc {
          jdbc_connection_string =&gt; &quot;jdbc:postgresql://ldatabase_rds_path?useSSL=true&quot;
          jdbc_user =&gt; &quot;username&quot;
          jdbc_password =&gt; &quot;password&quot;
          jdbc_driver_library =&gt; &quot;/home/z/Documents/postgresql-42.2.18.jar&quot;
          jdbc_driver_class =&gt; &quot;org.postgresql.Driver&quot;
          tracking_column =&gt; &quot;id&quot;
          tracking_column_type =&gt; &quot;numeric&quot;
           clean_run =&gt; true
          schedule =&gt; &quot;0 */1 * * *&quot;
          statement =&gt; &quot;SELECT id as id, type as type, z_id as z_id, sender_id as sender_id, receiver_id as receiver_id, status as status, amount as amount, fees as fees, created as created, metadata as metadata, funding_source_from_id as funding_source_from_id, funding_source_to_id as funding_source_to_id, is_parent as is_parent, destination_type as destination_type, source_type as source_type FROM payments_transfer&quot;
      }
  }
  output {
          stdout { codec =&gt; json_lines }
          elasticsearch {
                  hosts =&gt; [&quot;localhost:9200&quot;]
                  manage_template =&gt; false
                  index =&gt; &quot;payments_transfer_data&quot;
                  document_id =&gt; &quot;%{id}&quot;
           }
  }
  </code></pre>
  <p>It take much time to only get 1 record from the database!
  I tried some solutions like explicitly define a mapping so I added a mapping for the data like that:</p>
  <pre><code>PUT payments_transfer_data/_mapping/doc?include_type_name=true
  {
    &quot;properties&quot;: {
      &quot;@timestamp&quot;: {
        &quot;type&quot;: &quot;date&quot;
      },
      &quot;@version&quot;: {
        &quot;type&quot;: &quot;text&quot;,
        &quot;fields&quot;: {
          &quot;keyword&quot;: {
            &quot;type&quot;: &quot;keyword&quot;
          }
        }
      },
      &quot;amount&quot;: {
        &quot;type&quot;: &quot;float&quot;
      },
      &quot;created&quot;: {
        &quot;type&quot;: &quot;date&quot;
      },
      &quot;destination_type&quot;: {
        &quot;type&quot;: &quot;text&quot;,
        &quot;fields&quot;: {
          &quot;keyword&quot;: {
            &quot;type&quot;: &quot;keyword&quot;
          }
        }
      },
      &quot;z_id&quot;: {
        &quot;type&quot;: &quot;text&quot;,
        &quot;fields&quot;: {
          &quot;keyword&quot;: {
            &quot;type&quot;: &quot;keyword&quot;
          }
        }
      },
      &quot;fees&quot;: {
        &quot;type&quot;: &quot;float&quot;
      },
      &quot;funding_source_from_id&quot;: {
        &quot;type&quot;: &quot;long&quot;
      },
      &quot;funding_source_to_id&quot;: {
        &quot;type&quot;: &quot;long&quot;
      },
      &quot;id&quot;: {
        &quot;type&quot;: &quot;long&quot;
      },
      &quot;is_parent&quot;: {
        &quot;type&quot;: &quot;boolean&quot;
      },
      &quot;metadata&quot;: {
        &quot;type&quot;: &quot;keyword&quot;
      },
      &quot;receiver_id&quot;: {
        &quot;type&quot;: &quot;long&quot;
      },
      &quot;sender_id&quot;: {
        &quot;type&quot;: &quot;long&quot;
      },
      &quot;source_type&quot;: {
        &quot;type&quot;: &quot;text&quot;,
        &quot;fields&quot;: {
          &quot;keyword&quot;: {
            &quot;type&quot;: &quot;keyword&quot;
          }
        }
      },
      &quot;status&quot;: {
        &quot;type&quot;: &quot;text&quot;,
        &quot;fields&quot;: {
          &quot;keyword&quot;: {
            &quot;type&quot;: &quot;keyword&quot;
          }
        }
      },
      &quot;type&quot;: {
        &quot;type&quot;: &quot;text&quot;,
        &quot;fields&quot;: {
          &quot;keyword&quot;: {
            &quot;type&quot;: &quot;keyword&quot;
          }
        }
      }
    }
  }
  </code></pre>
  <p>Here is the only record that get:</p>
  <pre><code>    source_type:customer sender_id:3 destination_type:funding-source type:funded_transfer z_id:863a240c-2011-e911-8114-bacd823e9f1d receiver_id:65 status:processed amount:550 funding_source_from_id:332 @timestamp:Nov 8, 2020 @ 16:00:08.809 fees:5.61 is_parent:false created:Jan 5, 2019 @ 21:28:21.847 @version:1 id:2,160 funding_source_to_id: - metadata: - _id:2160 _type:doc _index:payments_transfer_data _score: -
  </code></pre>