未知为elasticsearch设置'hosts'

Sid*_*lly 3 exec elasticsearch logstash

我正在尝试在我的mac上运行logstash配置文件,但每次我这样做,我都会收到此错误:

 'Unknown setting 'hosts' for elasticsearch {:level=>:error} 
  Error: Something is wrong with your configuration.
  You may be interested in the '--configtest' flag which you can
  use to validate logstash's configuration before you choose
  to restart a running system.'
Run Code Online (Sandbox Code Playgroud)

我正在检索JIRA数据并将其发送到elasticsearch,但即使这个简单的任务也会返回错误.这是我的代码:

 input{
        exec {
             command => "curl -u username:password https://mycompany.atlassian.net/rest/api/latest/search?maxResults=10"
              interval => 300
               }
       }
  output{
       elasticsearch{
             hosts => ["127.0.0.1:9200"]
             index => "test"
        }
   }  
Run Code Online (Sandbox Code Playgroud)

Val*_*Val 8

您可能正在使用旧版本的Logstash(2.0之前版本),只需重命名hosts即可host,您可以:

   output{
       elasticsearch{
             host => ["127.0.0.1:9200"]
             index => "test"
        }
   }  
Run Code Online (Sandbox Code Playgroud)

  • 帮帮我,在我的情况下,我使用的是更新的版本,但是遵循基于旧版本的教程.将主机更改为主机,效果很好.:) (2认同)