# SQL data upload using JDBC-logstash

**URL:** https://discuss.elastic.co/t/sql-data-upload-using-jdbc-logstash/353435
**Category:** Logstash
**Created:** [February 16, 2024, 6:10am UTC](https://discuss.elastic.co/t/sql-data-upload-using-jdbc-logstash/353435 "2024-02-16T06:10:00Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)
#### Post date: [February 16, 2024, 10:25am UTC](https://discuss.elastic.co/t/sql-data-upload-using-jdbc-logstash/353435/2 "2024-02-16T10:25:06Z")

</div>

If the `leave_id` field is the primary key, you can use as doc\_id. If is not, then you should use fingerprint. Check [the similar topic](https://discuss.elastic.co/t/problem-using-fingerprint-for-my-documents-stored-in-elasticsearch/295101).

```auto
output {
  elasticsearch {
    hosts => ["http://localhost:9200"]
    user => "elastic"
    index => "index_mxcel_patient_leaves"
    document_id => "%{leave_id}"
    doc_as_upsert => true
  }

```

---

_[View the full topic](https://discuss.elastic.co/t/sql-data-upload-using-jdbc-logstash/353435)._
