gpt4 book ai didi

elasticsearch - 使用http_poll,logstash不会在kibana dahboard中创建索引模式。错误-LogStash::ConfigurationError“,:message =>”预期为#,

转载 作者:行者123 更新时间:2023-12-03 02:33:23 26 4
gpt4 key购买 nike

我想从logstash调用剩余的api,并希望将其发送到 Elasticsearch 以在kibana仪表板中显示数据。但是im gettig错误-

 [2019-12-23T16:55:24,887][ERROR][logstash.agent           ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of #, => at line 14, column 25 (byte 243) after output {\r\nelasticsearch{\r\nhosts=>{\"localhost:9200\"", :backtrace=>["D:/elasticinstall/logstash-7.4.0/logstash-core/lib/logstash/compiler.rb:41:in `compile_imperative'", "D:/elasticinstall/logstash-7.4.0/logstash-core/lib/logstash/compiler.rb:49:in `compile_graph'", "D:/elasticinstall/logstash-7.4.0/logstash-core/lib/logstash/compiler.rb:11:in `block in compile_sources'", "org/jruby/RubyArray.java:2584:in `map'", "D:/elasticinstall/logstash-7.4.0/logstash-core/lib/logstash/compiler.rb:10:in `compile_sources'", "org/logstash/execution/AbstractPipelineExt.java:153:in `initialize'", "org/logstash/execution/JavaBasePipelineExt.java:47:in `initialize'", "D:/elasticinstall/logstash-7.4.0/logstash-core/lib/logstash/java_pipeline.rb:26:in `initialize'", "D:/elasticinstall/logstash-7.4.0/logstash-core/lib/logstash/pipeline_action/create.rb:36:in `execute'", "D:/elasticinstall/logstash-7.4.0/logstash-core/lib/logstash/agent.rb:326:in `block in converge_state'"]}
[2019-12-23T16:55:25,982][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}
[2019-12-23T16:55:30,292][INFO ][logstash.runner ] Logstash shut down.


logstash code
input {
http_poller {
urls => {
urlname =>"http://.."
}
}
request_timeout => 60
schedule => {every=>"20s"}
codec => "line"
}
}


output {
elasticsearch{
hosts=>{"localhost:9200"}
index =>"logstash_http_poller"
}
stdout {
codec => rubydebug
}
}

Powershell命令
logstash -f logstash_http_poller.conf

最佳答案

您的elasticsearch输出错误,您不需要在主机周围使用花括号:

elasticsearch {
hosts => "localhost:9200" <-- change this
index => "logstash_http_poller"
}

关于elasticsearch - 使用http_poll,logstash不会在kibana dahboard中创建索引模式。错误-LogStash::ConfigurationError“,:message =>”预期为#,,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59455037/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com