Hello,
I am using HTTP input plugin in logstash config. I have been always sending data to logstash over HTTP POST method by using logstash API like this;
But is there a way to send data to logstash with basic authentication like this; curl -XPOST -u 'user:password' http://<logstashIP>:9605 -d '{"my": "data"}'
Thanks @Badger now i can send data with basic auth. But logstash returns error when i use keystore for password.
I have added the LS_PWD for password;
/usr/share/logstash/bin/logstash-keystore --path.settings /etc/logstash list
Using bundled JDK: /usr/share/logstash/jdk
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
Warning: Nashorn engine is planned to be removed from a future JDK release
Warning: Nashorn engine is planned to be removed from a future JDK release
Warning: Nashorn engine is planned to be removed from a future JDK release
2021-03-12 19:54:18,516 main ERROR Unable to locate appender "${sys:ls.log.format}_console" for logger config "root"
2021-03-12 19:54:18,518 main ERROR Unable to locate appender "${sys:ls.log.format}_rolling" for logger config "root"
2021-03-12 19:54:18,519 main ERROR Unable to locate appender "${sys:ls.log.format}_rolling_slowlog" for logger config "slowlog"
2021-03-12 19:54:18,519 main ERROR Unable to locate appender "${sys:ls.log.format}_console_slowlog" for logger config "slowlog"
ERROR: Failed to load settings file from "path.settings". Aborting... path.setting=/etc/logstash, exception=NameError, message=>uninitialized constant LogStash::Util::Password
es_pwd
es_usr
ls_pwd
Then i passed in input section;
input {
http {
user => "alican"
password => "${LS_PWD}"
port => 9605
type => "north"
codec => "json"
}
}
ERROR;
[ERROR] 2021-03-12 19:53:54.570 [Converge PipelineAction::Create<main>] agent - Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"Java::JavaLang::IllegalStateException", :message=>"Unable to configure plugins: Cannot evaluate `${ls_pwd}`. Replacement variable `ls_pwd` is not defined in a Logstash secret store or an environment entry and there is no default value given."
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.