如何使用Logstash插件-logstash-input-http [英] How to use logstash plugin - logstash-input-http

查看:106
本文介绍了如何使用Logstash插件-logstash-input-http的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在探索Logstash以接收HTTP上的输入.我已经使用以下方法安装了http插件:

I am exploring Logstash to receive inputs on HTTP. I have installed http plugin using:

插件安装logstash-input-http

安装成功.然后我尝试使用以下命令运行 logstash:

The installation was successfull. Then I tried to run logstash using following command:

logstash -e'输入{http {port => 8900}}输出{stdout {codec => ruby​​debug}}'

但是logstash终止而没有给出任何错误.

But logstash terminates without giving any error as such.

不知道如何验证插件是否正确安装.以及如何利用http插件测试示例请求.

Don't know how to verify whether plugin is installed correctly or not. And how to utilize the http plugin to test a sample request.

预先感谢!

推荐答案

我能够通过使用 .conf 文件而不是命令行参数来解决该问题.

I was able to solve the problem by using the .conf file instead of command line arguments.

我创建了一个类似于以下内容的 http-pipeline.conf 文件:

I created a http-pipeline.conf file similar to below:

input {
 http {
    host => "0.0.0.0"
    port => "8080"
  }
}

output {
    stdout {}
}

然后执行如下的Logstash:

And then executed Logstash like:

logstash -f http-pipeline.conf

使用POSTMAN工具,向我发送了一个带有示例的POST请求( http://localhost:8080 )到Logstash字符串和瞧,它出现在Logstash控制台上.

Using a POSTMAN tool, I sent a POST request(http://localhost:8080) to Logstash with a sample string and voila it appeared on the Logstash console.

这篇关于如何使用Logstash插件-logstash-input-http的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆