Logstash shut down

Sending Logstash logs to C:/ElasticSearch/logstash-7.7.0/logs which is now configured via log4j2.properties
[2020-06-03T11:12:10,384][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2020-06-03T11:12:12,375][INFO ][logstash.runner ] Starting Logstash {"logstash.version"=>"7.7.0"}
[2020-06-03T11:12:16,503][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of [A-Za-z0-9_-], [ \t\r\n], "#", "=>" at line 11, column 14 (byte 301) after input {\r\n jdbc {\r\n jdbc_driver_library => "mysql-connector-java-5.1.36-bin.jar"\r\n jdbc_driver_class => "com.mysql.jdbc.Driver"\r\n jdbc_connection_string => "jdbc:mysql://localhost:3306/sales"\r\n jdbc_user => "root"\r\n statement => "SELECT * FROM sales"\r\n }\r\n\r\n Output{\r\nelasticsearch", :backtrace=>["C:/ElasticSearch/logstash-7.7.0/logstash-core/lib/logstash/compiler.rb:58:in compile_imperative'", "C:/ElasticSearch/logstash-7.7.0/logstash-core/lib/logstash/compiler.rb:66:in compile_graph'", "C:/ElasticSearch/logstash-7.7.0/logstash-core/lib/logstash/compiler.rb:28:in block in compile_sources'", "org/jruby/RubyArray.java:2577:in map'", "C:/ElasticSearch/logstash-7.7.0/logstash-core/lib/logstash/compiler.rb:27:in compile_sources'", "org/logstash/execution/AbstractPipelineExt.java:181:in initialize'", "org/logstash/execution/JavaBasePipelineExt.java:67:in initialize'", "C:/ElasticSearch/logstash-7.7.0/logstash-core/lib/logstash/java_pipeline.rb:43:in initialize'", "C:/ElasticSearch/logstash-7.7.0/logstash-core/lib/logstash/pipeline_action/create.rb:52:in execute'", "C:/ElasticSearch/logstash-7.7.0/logstash-core/lib/logstash/agent.rb:342:in block in converge_state'"]}
[2020-06-03T11:12:20,637][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}
[2020-06-03T11:12:22,232][INFO ][logstash.runner ] Logstash shut down.

What does your configuration look like? Specifically, in the output section, what comes after the word elasticsearch?

input {

jdbc {

jdbc_driver_library => "mysql-connector-java-5.1.36-bin.jar"

jdbc_driver_class => "com.mysql.jdbc.Driver"

jdbc_connection_string => "jdbc:mysql://localhost:3306/sales"

jdbc_user => "root"

statement => "SELECT * FROM `sales`"

}

Output{

elasticsearch{

hosts=>["localhost:9200"]

index=>mobile_Date

}

stdout{}

}

You seem to be missing a } to close the input section.

I have close the input but the same error.

What exactly is the error message you are getting?

[2020-06-03T11:12:22,232][INFO ][logstash.runner ] Logstash shut down. I have tried index from CSV file and to Elasticseach it sending me the message above.

If I remember correctly, if you do not have a schedule option on a jdbc input then logstash will shut down once the statement has been executed, since it has nothing left to do.

input {

jdbc {

jdbc_driver_library => "mysql-connector-java-5.1.36-bin.jar"

jdbc_driver_class => "com.mysql.jdbc.Driver"

jdbc_connection_string => "jdbc:mysql://localhost:3306/sales"

jdbc_user => "root"

statement => "SELECT * FROM `sales`"

}

Output{

elasticsearch{

hosts=>["localhost:9200"]

index=>mobile_Date

}

stdout{}

}

}

The CSV
input{
file{path=>"C:/Users/James/Documents/Business Venture/Application/Data.csv"
Start_postion=>"begining"
sincedb_path=>"NULL"

}
filter{

csv{

    seperator=>","
    Column=>["No","Date","TransactionID","TransactionType","Dealer","CustomerName","Customer","Amount","Transfee","Commission","Recharge","Newbalance"]
}
mutate{convert=>["No","integer"]}
mutate{convert=>["Dealer","integer"]}
mutate{convert=>["Customer","integer"]}
mutate{convert=>["Amount","integer"]}
mutate{convert=>["Transfee","integer"]}
mutate{convert=>["Commission","integer"]}
mutate{convert=>["Newbalance","integer"]}

}

Output{
elasticsearch{
hosts=>"http://localhost:9200"
index=>mobile_Date
document_type=>"mobile_transaction"

}

stdout{}
}

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