使用Logstash http_poller输入插件时出现错误的GET URL

时间:2018-03-22 08:38:52

标签: logstash

尝试使用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正确...

1 个答案:

答案 0 :(得分:0)

原来是method => "GET"行。删除它就像一个魅力。