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

时间:2019-12-23 12:02:09

标签: elasticsearch logstash kibana

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

Uri
Powershell中的

命令  logstash -f logstash_http_poller.conf

2 个答案:

答案 0 :(得分:0)

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

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

答案 1 :(得分:0)

input {
  http_poller {
    urls => 
    { 
    test1 => "rest api url"
    }
    request_timeout => 60
    # Supports "cron", "every", "at" and "in" schedules by rufus scheduler
    schedule => { cron => "* * * * * UTC"}
    codec => "json"
    # A hash of request metadata info (timing, response headers, etc.) will be sent here
    metadata_target => "http_poller_metadata"
  }
}

output {
  stdout {
    codec => rubydebug
  }
}