# Logstash-input-jdbc empty records

**URL:** <https://discuss.elastic.co/t/logstash-input-jdbc-empty-records/107972>\
**Category:** Logstash\
**Created:** [November 16, 2017, 3:22pm UTC](https://discuss.elastic.co/t/logstash-input-jdbc-empty-records/107972 "2017-11-16T15:22:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mecbure](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mecbure/32/24344_2.png) [@mecbure](https://discuss.elastic.co/u/mecbure)\
**Post date:** [November 16, 2017, 3:22pm UTC](https://discuss.elastic.co/t/logstash-input-jdbc-empty-records/107972/1 "2017-11-16T15:22:36Z")

</div>

I am trying to get db records from postgres to elastic but I am not able to get first three columns. Pdate and record\_id are coming but others(text) not.

```
input {
  jdbc {
    jdbc_connection_string => "jdbc:postgresql://192.168.99.100:5432/postgres"
    jdbc_user => "postgres"
    jdbc_password => "admin"
    jdbc_validate_connection => true
    jdbc_driver_library => "/tert/postgresql-42.1.4.jar"
    jdbc_driver_class => "org.postgresql.Driver"
    jdbc_paging_enabled => true
    jdbc_page_size => 100
    statement => "select transliterated_author, sanitized_content, sanitized_title, pdate, record_id from public.tert where valid = true"
  }
}

output {
  elasticsearch {
    document_id => "%{record_id}"
    hosts => ["elasticsearch"]
  }
}
```

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [November 16, 2017, 3:27pm UTC](https://discuss.elastic.co/t/logstash-input-jdbc-empty-records/107972/2 "2017-11-16T15:27:05Z")

</div>

So what does an example document look like? What do you get if you use a `stdout { codec => rubydebug }` output?

---

<div class="post-metadata">

**Author:** ![mecbure](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mecbure/32/24344_2.png) [@mecbure](https://discuss.elastic.co/u/mecbure)\
**Post date:** [November 16, 2017, 3:39pm UTC](https://discuss.elastic.co/t/logstash-input-jdbc-empty-records/107972/3 "2017-11-16T15:39:04Z")

</div>

> [@magnusbaeck](#):
>
> stdout { codec =\> rubydebug }

logstash\_1 | {  
logstash\_1 | "record\_id" =\> "c8f9-11e7-b0ab-0242ac110002",  
logstash\_1 | "sanitized\_content" =\> "ABU DHABI, AUGUST 25. ARMINFO. Russian Grandmaster becomes sole leader Grandmaster Yemelin Vasily of Russia emerged as sole leader with 5 points at the end of the sixth round of the 13th Abu Dhabi Chess Festival being held at the Abu Dhabi Cultural Foundation. A pack of seven players are close on the heels of the leader just half a point behind. These include Grandmasters Lputian Smbat (Armenia), Poluljahov Aeksandr (Russia), Vladimirov Evgeny (Kazakhstan), Sargissian Gabriel (Armenia), Dizdar Goran (Croatia), Kotsur Pavel (Kazakhstan) and International Master Javad Maherrmszad (Azerbaijan) with a tally of 4.5 points each.",  
logstash\_1 | "sanitized\_title" =\> "info: AFTER SIX ROUNDS ARMENIAN CHESS PLAYERS RANK SECOND",  
logstash\_1 | "@timestamp" =\> 2017-11-16T15:34:08.465Z,  
logstash\_1 | "pdate" =\> 2003-08-26T00:00:00.000Z,  
logstash\_1 | "@version" =\> "1",  
logstash\_1 | "transliterated\_author" =\> nil  
logstash\_1 | }

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [November 16, 2017, 3:44pm UTC](https://discuss.elastic.co/t/logstash-input-jdbc-empty-records/107972/4 "2017-11-16T15:44:38Z")

</div>

Okay, well that looks good. What does the corresponding document in ES look like?

---

<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:** [December 14, 2017, 3:44pm UTC](https://discuss.elastic.co/t/logstash-input-jdbc-empty-records/107972/5 "2017-12-14T15:44:58Z")

</div>

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