# Logstash not work(

**URL:** <https://discuss.elastic.co/t/logstash-not-work/208664>\
**Category:** Logstash\
**Created:** [November 20, 2019, 9:48am UTC](https://discuss.elastic.co/t/logstash-not-work/208664 "2019-11-20T09:48:21Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jleLLlka\_Kozlov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jlelllka_kozlov/32/58021_2.png) [@jleLLlka\_Kozlov](https://discuss.elastic.co/u/jleLLlka_Kozlov)\
**Post date:** [November 20, 2019, 9:48am UTC](https://discuss.elastic.co/t/logstash-not-work/208664/1 "2019-11-20T09:48:21Z")

</div>

[2019-11-20T09:31:30,990][INFO][logstash.runner] Starting Logstash {"logstash.version"=\>"6.8.4"}  
[2019-11-20T09:31:37,888][INFO][logstash.pipeline] Starting pipeline {:pipeline\_id=\>"main", "pipeline.workers"=\>4, "pipeline.batch.size"=\>125, "pipeline.batch.delay"=\>50}  
[2019-11-20T09:31:38,480][INFO][logstash.outputs.elasticsearch] Elasticsearch pool URLs updated {:changes=\>{:removed=\>, :added=\>[[http://localhost:9200/](http://localhost:9200/)]}}  
[2019-11-20T09:31:38,767][WARN][logstash.outputs.elasticsearch] Restored connection to ES instance {:url=\>"[http://localhost:9200/](http://localhost:9200/)"}  
[2019-11-20T09:31:38,853][INFO][logstash.outputs.elasticsearch] ES Output version determined {:es\_version=\>6}  
[2019-11-20T09:31:38,858][WARN][logstash.outputs.elasticsearch] Detected a 6.x and above cluster: the `type` event field won't be used to determine the document \_type {:es\_version=\>6}  
[2019-11-20T09:31:38,896][INFO][logstash.outputs.elasticsearch] New Elasticsearch output {:class=\>"LogStash::Outputs::ElasticSearch", :hosts=\>["[//localhost:9200](https://localhost:9200)"]}  
[2019-11-20T09:31:38,907][INFO][logstash.outputs.elasticsearch] Using default mapping template  
[2019-11-20T09:31:38,940][INFO][logstash.outputs.elasticsearch] Attempting to install template {:manage\_template=\>{"template"=\>"logstash-_", "version"=\>60001, "settings"=\>{"index.refresh\_interval"=\>"5s"}, "mappings"=\>{"default"=\>{"dynamic\_templates"=\>[{"message\_field"=\>{"path\_match"=\>"message", "match\_mapping\_type"=\>"string", "mapping"=\>{"type"=\>"text", "norms"=\>false}}}, {"string\_fields"=\>{"match"=\>"_", "match\_mapping\_type"=\>"string", "mapping"=\>{"type"=\>"text", "norms"=\>false, "fields"=\>{"keyword"=\>{"type"=\>"keyword", "ignore\_above"=\>256}}}}}], "properties"=\>{"@timestamp"=\>{"type"=\>"date"}, "@version"=\>{"type"=\>"keyword"}, "geoip"=\>{"dynamic"=\>true, "properties"=\>{"ip"=\>{"type"=\>"ip"}, "location"=\>{"type"=\>"geo\_point"}, "latitude"=\>{"type"=\>"half\_float"}, "longitude"=\>{"type"=\>"half\_float"}}}}}}}}  
[2019-11-20T09:31:39,089][INFO][logstash.pipeline] Pipeline started successfully {:pipeline\_id=\>"main", :thread=\>"#\<Thread:0xf892ed4 run\>"}  
[2019-11-20T09:31:39,154][INFO][logstash.agent] Pipelines running {:count=\>1, :running\_pipelines=\>[:main], :non\_running\_pipelines=\>}  
[2019-11-20T09:31:39,576][INFO][logstash.agent] Successfully started Logstash API endpoint {:port=\>9600}

---

<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:** [November 20, 2019, 2:14pm UTC](https://discuss.elastic.co/t/logstash-not-work/208664/2 "2019-11-20T14:14:00Z")

</div>

Did you have a question?

---

<div class="post-metadata">

**Author:** ![jleLLlka\_Kozlov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jlelllka_kozlov/32/58021_2.png) [@jleLLlka\_Kozlov](https://discuss.elastic.co/u/jleLLlka_Kozlov)\
**Post date:** [November 20, 2019, 4:56pm UTC](https://discuss.elastic.co/t/logstash-not-work/208664/3 "2019-11-20T16:56:18Z")

</div>

I have error  
this is my config

input {  
jdbc {  
jdbc\_connection\_string =\> "jdbc:mariadb://localhost:3306/testdb"  
jdbc\_user =\> "root"  
jdbc\_password =\> "UHzip7ugwTzocLy"  
jdbc\_driver\_library =\> "/opt/mariadb-java-client-2.5.1-javadoc.jar"  
jdbc\_driver\_class =\> "org.mariadb.jdbc.Driver"  
statement =\> "SELECT \* FROM testtable"  
schedule =\> "0 \* \* \* \*"  
}  
}  
output {  
stdout { codec =\> json\_lines }  
elasticsearch {  
"hosts" =\> "localhost:9200"  
"index" =\> "test-migrate"  
"document\_type" =\> "data"  
}  
}

this config is autoloading then system start

this is logs

[2019-11-20T16:45:57,831][INFO][logstash.outputs.elasticsearch] Using default mapping template  
[2019-11-20T16:45:57,861][INFO][logstash.outputs.elasticsearch] Attempting to install template {:manage\_template=\>{"template"=\>"logstash-_", "version"=\>60001, "settings"=\>{"index.refresh\_interval"=\>"5s"}, "mappings"=\>{"default"=\>{"dynamic\_templates"=\>[{"message\_field"=\>{"path\_match"=\>"message", "match\_mapping\_type"=\>"string", "mapping"=\>{"type"=\>"text", "norms"=\>false}}}, {"string\_fields"=\>{"match"=\>"_", "match\_mapping\_type"=\>"string", "mapping"=\>{"type"=\>"text", "norms"=\>false, "fields"=\>{"keyword"=\>{"type"=\>"keyword", "ignore\_above"=\>256}}}}}], "properties"=\>{"@timestamp"=\>{"type"=\>"date"}, "@version"=\>{"type"=\>"keyword"}, "geoip"=\>{"dynamic"=\>true, "properties"=\>{"ip"=\>{"type"=\>"ip"}, "location"=\>{"type"=\>"geo\_point"}, "latitude"=\>{"type"=\>"half\_float"}, "longitude"=\>{"type"=\>"half\_float"}}}}}}}}  
[2019-11-20T16:45:57,973][INFO][logstash.pipeline] Pipeline started successfully {:pipeline\_id=\>"main", :thread=\>"#\<Thread:0x5771fb13 run\>"}  
[2019-11-20T16:45:58,043][INFO][logstash.agent] Pipelines running {:count=\>1, :running\_pipelines=\>[:main], :non\_running\_pipelines=\>}  
[2019-11-20T16:45:58,407][INFO][logstash.agent] Successfully started Logstash API endpoint {:port=\>9600}

not create index in elastic search

how to set up elastic with in jbdc mariadb driver auto update sql data?  
very big thanks!!!!

---

<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:** [November 20, 2019, 5:58pm UTC](https://discuss.elastic.co/t/logstash-not-work/208664/4 "2019-11-20T17:58:34Z")

</div>

It is not logging any errors, which suggests it is connecting to the database OK. Your schedule means the query will execute at the start of every hour (minute zero). Are you waiting long enough for that to happen?

---

<div class="post-metadata">

**Author:** ![jleLLlka\_Kozlov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jlelllka_kozlov/32/58021_2.png) [@jleLLlka\_Kozlov](https://discuss.elastic.co/u/jleLLlka_Kozlov)\
**Post date:** [November 20, 2019, 7:31pm UTC](https://discuss.elastic.co/t/logstash-not-work/208664/5 "2019-11-20T19:31:35Z")

</div>

Today, every hour, check.

No data insered in elasticsearch(

near result from command line

curl -XPOST '[http://localhost:9200/test-migrate/\_search?pret](http://localhost:9200/test-migrate/_search?pret) ty=true' -H "Content-Type: application/json" -d '{}'  
{  
"error" : {  
"root\_cause" : [  
{  
"type" : "index\_not\_found\_exception",  
"reason" : "no such index",  
"resource.type" : "index\_or\_alias",  
"resource.id" : "test-migrate",  
"index\_uuid" : "_na_",  
"index" : "test-migrate"  
}  
],  
"type" : "index\_not\_found\_exception",  
"reason" : "no such index",  
"resource.type" : "index\_or\_alias",  
"resource.id" : "test-migrate",  
"index\_uuid" : "_na_",  
"index" : "test-migrate"  
},  
"status" : 404  
}

---

<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:** [November 20, 2019, 7:40pm UTC](https://discuss.elastic.co/t/logstash-not-work/208664/6 "2019-11-20T19:40:41Z")

</div>

The only explanation I can think of is that there is no data in testtable, so the SELECT does not return any rows, so no events are created. Does the stdout output show anything?

---

<div class="post-metadata">

**Author:** ![jleLLlka\_Kozlov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jlelllka_kozlov/32/58021_2.png) [@jleLLlka\_Kozlov](https://discuss.elastic.co/u/jleLLlka_Kozlov)\
**Post date:** [November 20, 2019, 7:45pm UTC](https://discuss.elastic.co/t/logstash-not-work/208664/7 "2019-11-20T19:45:51Z")

</div>

Database changed  
MariaDB [testdb]\> select \* from testtable  
-\> ;  
+----------+----------+-----------+-----------+----------------------------+  
| PersonID | LastName | FirstName | City | Date |  
+----------+----------+-----------+-----------+----------------------------+  
| 4005 | Kallis | Jaques | Cape Town | 2016-05-23 16:12:03.568810 |  
| 4004 | Baron | Richard | Cape Town | 2016-05-23 16:12:04.370460 |  
| 4003 | McWell | Sharon | Cape Town | 2016-05-23 16:12:06.874801 |  
+----------+----------+-----------+-----------+----------------------------+  
3 rows in set (0.00 sec)

---

<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 18, 2019, 7:52pm UTC](https://discuss.elastic.co/t/logstash-not-work/208664/8 "2019-12-18T19:52:55Z")

</div>

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