# Stdout codec json\_lines is empty

**URL:** <https://discuss.elastic.co/t/stdout-codec-json-lines-is-empty/214834>\
**Category:** Logstash\
**Created:** [January 13, 2020, 1:06pm UTC](https://discuss.elastic.co/t/stdout-codec-json-lines-is-empty/214834 "2020-01-13T13:06:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kostis95](https://avatars.discourse-cdn.com/v4/letter/k/ccd318/32.png) [@Kostis95](https://discuss.elastic.co/u/Kostis95)\
**Post date:** [January 13, 2020, 1:06pm UTC](https://discuss.elastic.co/t/stdout-codec-json-lines-is-empty/214834/1 "2020-01-13T13:06:13Z")

</div>

Hi there,

I'm still trying to connect my postgresql database to elastic. I've got all the required files:  
logstash.yml, pipelines.yml and p1.conf (in my local/etc/logstash). However I'm only getting Successfully started Logstash API endpoint and no result, if I run logstash --debug I get: stdout { codec =\> json\_lines } ```]

So it's empty...  
Here are some lines I'm also getting from the debug:

**config LogStash::Inputs::Jdbc/@statement = "SELECT \* from phpbb\_banlist"**  
**config LogStash::Inputs::Jdbc/@jdbc\_validation\_timeout = 3600**  
**config LogStash::Inputs::Jdbc/@connection\_retry\_attempts = 1**  
**config LogStash::Inputs::Jdbc/@connection\_retry\_attempts\_wait\_time = 0.5**

**[DEBUG][org.logstash.ackedqueue.io.MmapPageIOV2] PageIO recovery element index:0, readNextElement exception: Element invalid length**

**[DEBUG][logstash.javapipeline] Starting pipeline {:pipeline\_id=\>"my-pipeline\_1"}**

**[WARN][org.logstash.instrument.metrics.gauge.LazyDelegatingGauge][my-pipeline\_1] A gauge metric of an unknown type (org.jruby.RubyArray) has been create for key: cluster\_uuids. This may result in invalid serialization. It is recommended to log an issue to the responsible developer/development team.**

**[INFO][logstash.javapipeline][my-pipeline\_1] Starting pipeline {:pipeline\_id=\>"my-pipeline\_1", "pipeline.workers"=\>1, "pipeline.batch.size"=\>125, "pipeline.batch.delay"=\>50, "pipeline.max\_inflight"=\>125, "pipeline.sources"=\>["/usr/local/etc/logstash/p1.conf"], :thread=\>"#\<Thread:0x2dc0c9bc run\>"}**

**[logstash.javapipeline][my-pipeline\_1] Pipeline started {"pipeline.id"=\>"my-pipeline\_1"}**

**[DEBUG][logstash.javapipeline] Pipeline started successfully {:pipeline\_id=\>"my-pipeline\_1", :thread=\>"#\<Thread:0x2dc0c9bc run\>"}**

**[DEBUG][org.logstash.execution.PeriodicFlush][my-pipeline\_1] Pushing flush onto pipeline.**

**[INFO][logstash.agent] Pipelines running {:count=\>1, :running\_pipelines=\>[:"my-pipeline\_1"], :non\_running\_pipelines=\>[]}**

**[DEBUG][logstash.agent] Starting puma**

**[DEBUG][logstash.agent] Trying to start WebServer {:port=\>9600}**

**[DEBUG][logstash.api.service] [api-service] start**

**[INFO][logstash.agent] Successfully started Logstash API endpoint {:port=\>9600}**

**[DEBUG][logstash.inputs.jdbc][my-pipeline\_1] loading ~/Desktop/postgresql-42.2.9.jar**

**[DEBUG][logstash.inputs.jdbc] config LogStash::Inputs::Jdbc/@use\_prepared\_statements = false**  
**[DEBUG][logstash.inputs.jdbc] config LogStash::Inputs::Jdbc/@prepared\_statement\_name = ""**

Maybe somebody can help me to sync my postgresql database with elastic (because it's taking forever this way), I've been searching the web for a solution for a long time. I was thinking the problem is the prepared statement being empty but my .conf file is all in order and as simple as can be.

---

<div class="post-metadata">

**Author:** ![Kostis95](https://avatars.discourse-cdn.com/v4/letter/k/ccd318/32.png) [@Kostis95](https://discuss.elastic.co/u/Kostis95)\
**Post date:** [January 14, 2020, 2:57pm UTC](https://discuss.elastic.co/t/stdout-codec-json-lines-is-empty/214834/2 "2020-01-14T14:57:15Z")

</div>

Also my configuration file is like the following:

input {  
jdbc {  
# Postgres jdbc connection string to our database,  
jdbc\_connection\_string =\> "jdbc:postgresql://hostname:port/databasename"

```
    # The user we wish to execute our statement as
    jdbc_user => "USER"

#password for the user
jdbc_password => "PASSWORD"

jdbc_validate_connection => true

    # The path to our downloaded jdbc driver
    jdbc_driver_library => "~/Desktop/postgresql-42.2.9.jar"

    # The name of the driver class for Postgresql
    jdbc_driver_class => "org.postgresql.Driver"

    # our query
    statement => 'select * from phpbb_banlist'
}

```

}  
output {  
stdout { codec =\> json\_lines }  
}

---

<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:** [February 11, 2020, 2:57pm UTC](https://discuss.elastic.co/t/stdout-codec-json-lines-is-empty/214834/3 "2020-02-11T14:57:17Z")

</div>

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