# I am unable to sync data from postgresql, Basically I am not able to start logstash

**URL:** https://discuss.elastic.co/t/i-am-unable-to-sync-data-from-postgresql-basically-i-am-not-able-to-start-logstash/278331
**Category:** Logstash
**Created:** [July 10, 2021, 1:05pm UTC](https://discuss.elastic.co/t/i-am-unable-to-sync-data-from-postgresql-basically-i-am-not-able-to-start-logstash/278331 "2021-07-10T13:05:55Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![NETESH\_KUMAR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/netesh_kumar/32/91464_2.png) [@NETESH\_KUMAR](https://discuss.elastic.co/u/NETESH_KUMAR)
#### Post date: [July 10, 2021, 1:05pm UTC](https://discuss.elastic.co/t/i-am-unable-to-sync-data-from-postgresql-basically-i-am-not-able-to-start-logstash/278331/1 "2021-07-10T13:05:55Z")

</div>

#Here is my config file  
#--------- config file start----------------

# Sample Logstash configuration for creating a simple

# Beats -\> Logstash -\> Elasticsearch pipeline.

input{  
jdbc{  
jdbc\_connection\_string =\> "jdbc:postgresql://localhost:5432/dbName"  
jdbc\_user =\> "postgres"  
jdbc\_password =\> "root"  
jdbc\_driver\_class =\> "org.postgresql.Driver"  
statement =\> "SELECT \* from public."questions\””  
}  
}

output {  
elasticsearch {  
hosts =\> ["[http://localhost:9200](http://localhost:9200)"]  
index =\> "questions"  
document\_id =\> "questions\_%{id}"  
doc\_as\_upsert =\> true  
#user =\> "elastic"  
#password =\> "changeme"  
}  
}

#------------------------------config file end--------------------------

Error:-  
"Using bundled JDK: ""  
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.  
Sending Logstash logs to C:/workspace/ELK/logstash-7.13.3-windows-x86\_64/logstash-7.13.3/logs which is now configured via log4j2.properties  
[2021-07-10T18:28:25,462][INFO][logstash.runner] Log4j configuration path used is: C:\workspace\ELK\logstash-7.13.3-windows-x86\_64\logstash-7.13.3\config\log4j2.properties  
[2021-07-10T18:28:25,474][INFO][logstash.runner] Starting Logstash {"logstash.version"=\>"7.13.3", "jruby.version"=\>"jruby 9.2.16.0 (2.5.7) 2021-03-03 f82228dc32 OpenJDK 64-Bit Server VM 11.0.11+9 on 11.0.11+9 +indy +jit [mswin32-x86\_64]"}  
[2021-07-10T18:28:25,555][WARN][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified  
[2021-07-10T18:28:26,261][INFO][logstash.agent] Successfully started Logstash API endpoint {:port=\>9600}  
[2021-07-10T18:28:26,260][ERROR][logstash.agent] Failed to execute action {:action=\>LogStash::PipelineAction::Create/pipeline\_id:main, :exception=\>"LogStash::ConfigurationError", :message=\>"Expected one of [\t\r\n], "#", "{", "}" at line 14, column 16 (byte 299) after input{\r\n\tjdbc{\r\n\t\tjdbc\_connection\_string =\> "jdbc:postgresql://localhost:5432/elk\_poc"\r\n\t\tjdbc\_user =\> "postgres"\r\n\t\tjdbc\_password =\> "root"\r\n\t\tjdbc\_driver\_class =\> "org.postgresql.Driver"\r\n\t\tstatement =\> "SELECT \* from public.\"questions\ΓÇ¥ΓÇ¥\r\n\t}\r\n}\r\n\r\noutput {\r\n elasticsearch {\r\n hosts =\> ["", :backtrace=\>["C:/workspace/ELK/logstash-7.13.3-windows-x86\_64/logstash-7.13.3/logstash-core/lib/logstash/compiler.rb:32:in `compile_imperative'", "org/logstash/execution/AbstractPipelineExt.java:187:in `initialize'", "org/logstash/execution/JavaBasePipelineExt.java:72:in `initialize'", "C:/workspace/ELK/logstash-7.13.3-windows-x86_64/logstash-7.13.3/logstash-core/lib/logstash/java_pipeline.rb:47:in `initialize'", "C:/workspace/ELK/logstash-7.13.3-windows-x86\_64/logstash-7.13.3/logstash-core/lib/logstash/pipeline\_action/create.rb:52:in `execute'", "C:/workspace/ELK/logstash-7.13.3-windows-x86_64/logstash-7.13.3/logstash-core/lib/logstash/agent.rb:389:in `block in converge\_state'"]}  
[2021-07-10T18:28:26,373][INFO][logstash.runner] Logstash shut down.  
[2021-07-10T18:28:26,383][FATAL][org.logstash.Logstash] Logstash stopped processing because of an error: (SystemExit) exit  
org.jruby.exceptions.SystemExit: (SystemExit) exit  
at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:747) ~[jruby-complete-9.2.16.0.jar:?]  
at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:710) ~[jruby-complete-9.2.16.0.jar:?]  
at C\_3a\_.workspace.ELK.logstash\_minus\_7\_dot\_13\_dot\_3\_minus\_windows\_minus\_x86\_64.logstash\_minus\_7\_dot\_13\_dot\_3.lib.bootstrap.environment.(C:\workspace\ELK\logstash-7.13.3-windows-x86\_64\logstash-7.13.3\lib\bootstrap\environment.rb:89) ~[?:?]

can someone help me with it, I am a beginner.

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [July 10, 2021, 1:21pm UTC](https://discuss.elastic.co/t/i-am-unable-to-sync-data-from-postgresql-basically-i-am-not-able-to-start-logstash/278331/2 "2021-07-10T13:21:45Z")

</div>

> [@NETESH\_KUMAR](#):
>
> statement =\> "SELECT \* from public."questions\””  
> }  
> }
> 
> output {  
> elasticsearch {  
> hosts =\> ["[http://localhost:9200](http://localhost:9200)"]

That looks like you have curly quotes are the end of your SQL statement, so they do not close the double quotes at the start. logstash is parsing

```auto
SELECT * from public."questions\””
}
}

output {
elasticsearch {
hosts => [

```

as the SQL statement, then cannot understand how to parse

```auto
http://localhost:9200

```

as an option of the jdbc input.

---

<div class="post-metadata">

### Author: ![NETESH\_KUMAR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/netesh_kumar/32/91464_2.png) [@NETESH\_KUMAR](https://discuss.elastic.co/u/NETESH_KUMAR)
#### Post date: [July 10, 2021, 2:50pm UTC](https://discuss.elastic.co/t/i-am-unable-to-sync-data-from-postgresql-basically-i-am-not-able-to-start-logstash/278331/3 "2021-07-10T14:50:47Z")

</div>

thanks a lot, @Badger. after removing quotes, it solve my problem.

---

<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: [August 7, 2021, 2:50pm UTC](https://discuss.elastic.co/t/i-am-unable-to-sync-data-from-postgresql-basically-i-am-not-able-to-start-logstash/278331/4 "2021-08-07T14:50:53Z")

</div>

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