"LogStash::ConfigurationError", :message=>"Expected one of #


(idrees) #1

Dear all,
i am using elasticsearch 6.4 with logstash and searchguard with ssl enabled on centos 7.
my logstash configuration file is below

input {
file {
path =>"/root/logstashProjects/studentwithdraw/student_withdraw.csv"
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
filter {
csv {
separator => ","
columns => ["DEPT_NAME" ,"CERT_NAME", "SPEC_NAME", "STUDENT_NO", "STUD_NAME", "GENDER", "ADVISORS_NAME", "ACADEMIC_YEAR", "REQUEST_NO", "withdraw_reason_category", "STATUS", "WITHDRAW_DATE", "LECTURER", "COURSE_NO", "COURSE_NAME", "SECTION_NO", "TOTAL_REG"]
}
mutate {convert => ["SECTION_NO", "integer"] }
mutate {convert => ["TOTAL_REG", "integer"] }
}
output {
elasticsearch {
user => admin
password => mypassword
hosts => "https://myservername"
index => "myindex"
ssl => true
ssl_certificate_verification => false
truststore => "/root/etc/elasticsearch/truststore.jks"
truststore_password => mypassword
}
stdout { }
}

i run it with the following command

bin/logstash -f /root/logstashProjects/studentwithdraw/logstash_withdraw.config

it give the following error

[root@bigdata logstash]# bin/logstash -f /root/logstashProjects/studentwithdraw/logstash_withdraw.config
WARNING: Could not find logstash.yml which is typically located in $LS_HOME/config or /etc/logstash. You can specify the path using --path.settings. Continuing using the defaults
Could not find log4j2 configuration at path /usr/share/logstash/config/log4j2.properties. Using default config which logs errors to the console
[WARN ] 2018-10-14 09:23:04.098 [LogStash::Runner] multilocal - Ignoring the 'pipelines.yml' file because modules or command line options are specified
[INFO ] 2018-10-14 09:23:05.137 [LogStash::Runner] runner - Starting Logstash {"logstash.version"=>"6.4.2"}
[ERROR] 2018-10-14 09:23:06.162 [Converge PipelineAction::Create] agent - Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of #, { at line 26, column 1 (byte 870) after output { \r\n elasticsearch {\r\n user => admin\r\n password => admin\r\n hosts => "https://bigdata.hct.org"\r\n index => "withdrawindex"\r\n ssl => true\r\n ssl_certificate_verification => false\r\n truststore => "/root/etc/elasticsearch/truststore.jks"\r\n truststore_password => 8e204c774e79387f887e\r\n", :backtrace=>["/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:41:in compile_imperative'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:49:incompile_graph'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:11:in block in compile_sources'", "org/jruby/RubyArray.java:2486:inmap'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:10:in compile_sources'", "org/logstash/execution/AbstractPipelineExt.java:149:ininitialize'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:22:in initialize'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:90:ininitialize'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline_action/create.rb:38:in execute'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:309:inblock in converge_state'"]}
[INFO ] 2018-10-14 09:23:06.631 [Api Webserver] agent - Successfully started Logstash API endpoint {:port=>9600}

can somebody guide me with this issue please?


(idrees) #2

hi,
i fixed it by puting the password in double quotations. please find the working file below

input {
file {
path =>"/root/logstashProjects/studentwithdraw/student_withdraw.csv"
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
filter {
csv {
separator => ","
columns => ["DEPT_NAME" ,"CERT_NAME", "SPEC_NAME", "STUDENT_NO", "STUD_NAME", "GENDER", "ADVISORS_NAME", "ACADEMIC_YEAR", "REQUEST_NO", "withdraw_reason_category", "STATUS", "WITHDRAW_DATE", "LECTURER", "COURSE_NO", "COURSE_NAME", "SECTION_NO", "TOTAL_REG"]
}
mutate {convert => ["SECTION_NO", "integer"] }
mutate {convert => ["TOTAL_REG", "integer"] }
}
output {
elasticsearch {
user => admin
password => mypassword
hosts => "https://myserver:myport"
index => "withdrawindex"
ssl => true
ssl_certificate_verification => false
truststore => "/etc/elasticsearch/truststore.jks"
truststore_password => "mypassword"
document_type => "withdrawdocument"
}
stdout { }
}


(system) #3

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