尝试使用Logstash http_poller输入插件从公共API中提取数据:
input {
http_poller {
urls => {
method => "GET"
url => "https://api.example.com/v1/service/"
}
request_timeout => 60
schedule => { cron => "0 * * * *"}
codec => "json"
metadata_target => "http_poller_metadata"
}
}
filter {
}
output {
elasticsearch {
hosts => ["localhost:9200"]
}
}
继续收到错误的网址错误:
[ERROR][logstash.pipeline] Pipeline aborted due to error {:pipeline_id=>"main", :exception=>#<LogStash::ConfigurationError: Invalid URL GET>...]
知道造成这种情况的原因是什么? API的URL正确...
答案 0 :(得分:0)
原来是method => "GET"
行。删除它就像一个魅力。