Http input plugin
logstash作为一个数据输入端。提供http服务,接收客户端的http请求,获取发送的内容。
在config目录下新建文件:
vim config/http-input.yml
input {
http {
codec => "json"
ssl => false
port => 8989
}
}
filter {
json {
source => "message"
}
}
output {
stdout { codec => json }
}
启动:
bin/logstash -f ./config/http-input.yml
启动后输出:
[root@ss1 logstash-6.5.4]# bin/logstash -f ./config/http-input.yml
Sending Logstash logs to /root/logstash/logstash-6.5.4/logs which is now configured via log4j2.properties
[2019-04-04T08:52:23,884][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2019-04-04T08:52:23,925][INFO ][logstash.runner ] Starting Logstash {"logstash.version"=>"6.5.4"}
[2019-04-04T08:52:30,433][INFO ][logstash.pipeline ] Starting pipeline {:pipeline_id=>"main", "pipeline.workers"=>2, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>50}
[2019-04-04T08:52:31,118][INFO ][logstash.pipeline ] Pipeline started successfully {:pipeline_id=>"main", :thread=>"#<Thread:0x102cff5e run>"}
[2019-04-04T08:52:31,184][INFO ][logstash.inputs.http ] Starting http input listener {:address=>"0.0.0.0:8989", :ssl=>"false"}
[2019-04-04T08:52:31,291][INFO ][logstash.agent ] Pipelines running {:count=>1, :running_pipelines=>[:main], :non_running_pipelines=>[]}
[2019-04-04T08:52:31,930][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9601}
{"headers":{"request_path":"/","connection":"keep-alive","content_length":"247","request_method":"POST","cache_control":"no-cache","http_version":"HTTP/1.1","postman_token":"7e8dc2ea-f569-42a2-84f4-c53506777c61","content_type":"text/plain","accept_encoding":"gzip, deflate","http_host":"111.111.111.111:8989","http_user_agent":"PostmanRuntime/6.2.5","http_accept":"*/*"},"host":"111.111.111.111","LogType":"maha1","language_type":"heartbeat","LogId":"","ErrorCode":"2","@version":"1","responseLogTime":"2019-04-04 09:40:47.797","srcfile":"c:\\Program.cs","LogMessage":".Net Test","Input":"","Level":"Info","@timestamp":"2019-04-04T08:57:18.780Z"}
另外,logstash有个http poller input,是自己主动去http端点采集数据,如果采集spring boot的jmx服务器监控数据。
参考:
https://www.elastic.co/guide/en/logstash/current/plugins-inputs-http.html
Http input plugin的更多相关文章
- jQuery Tags Input Plugin 插件的使用
一个jquery开发的标签功能加强插件,可以生成或删除标签,还能对输入重复标签进行检查,和JQuery autocomplete插件配合实现自动完成功能. 官网:http://xoxco.com/pr ...
- Logstash:input plugin 介绍
- Collecting metrics with the PostgreSQL and TimescaleDB output plugin for Telegraf
转自:https://docs.timescale.com/v1.3/tutorials/telegraf-output-plugin 文章演示了如何使用pg output 插件 以及Telegraf ...
- logstash日志分析的配置和使用
logstash是一个数据分析软件,主要目的是分析log日志.整一套软件可以当作一个MVC模型,logstash是controller层,Elasticsearch是一个model层,kibana是v ...
- A session of Log Collect, Retrieval and Analysis using ELK Stack
Motivation 运维过程中对问题的定位往往需要跟踪和定位日志.分布式和弹性计算的引入,使得日志的定位和分析变得越发复杂. 本次实践主要的目的是考察现有成熟的日志收集.检索和分析方案:Kafka+ ...
- 移动端-js触摸事件
开发者工具 在移动开发中,一种较为容易的做法是,先在桌面上开始原型设计,然后再在打算要支持的设备上处理移动特有的部分.多点触摸正是难以在PC上进行测试的那些功能之一,因为大部分的PC都没有触摸输入. ...
- logstash 1.5.3 配置使用redis做续传
logstash是ELK中的一员大将, redis插件也是<The Logstash Book>中介绍的一个很好用的玩意儿. 之前,用比较小的集群部署的时候,没有介入redis中间件,所以 ...
- 移动互联网终端的touch事件,touchstart, touchend, touchmove
如果我们允许用户在页面上用类似桌面浏览器鼠标手势的方式来控制WEB APP,这个页面上肯定是有很多可点击区域的,如果用户触摸到了那些可点击区域怎么办呢??诸如智能手机和平板电脑一类的移动设备通常会有一 ...
- logstash
logstash作为数据搜集器,主要分为三个部分:input->filter->output 作为pipeline的形式进行处理,支持复杂的操作,如发邮件等 input配置数据的输入和简 ...
随机推荐
- 通用mapper认识和用法
目录 0. 认识 1. 导包 2. mybatis的config文件:mybatis-mapper-config.xml 3. spring与mybatis整合配置文件:mybatis.xml 4. ...
- PHP制作个人博客-广告位添加与调用 推荐文章数据调取
上一节博客的导航我们已经动态调取,这一节我们主讲一下如何根据页面布局,后台添加广告位,及模板上动态调取广告.博客推荐文章的数据调用. 首先我们在云码博客的后台添加10条左右的测试数据,thinkcmf ...
- H5与C3权威指南笔记--transition动画
translation:过渡 举个栗子:transition: width 1s linear; transition有三个属性,分别是transition-property, transition- ...
- java 线程方法 ---- sleep()
class MyThread implements Runnable{ @Override public void run() { for (int i = 0; i < 5; i++){ Sy ...
- 【设计模式】工厂方法模式 Factory Method Pattern
在简单工厂模式中产品的创建统一在工厂类的静态工厂方法中创建,体现了面形对象的封装性,客户程序不需要知道产品产生的细节,也体现了面向对象的单一职责原则(SRP),这样在产品很少的情况下使用起来还是很方便 ...
- Android View的重绘过程之Measure
博客首页:http://www.cnblogs.com/kezhuang/p/ View绘制的三部曲, 测量,布局,绘画今天我们分析测量过程 view的测量是从ViewRootImpl发起的,Vie ...
- vue的组件化运用(数据在两个组件互传,小问题总结)
一.vue的组件化应用 首先,知道有哪些相关的属性需要用到,再慢慢去理解,运用. 1.两个vue页面 2. slot占位符(可用可不用) 3.props内置属性 4.watch监听函数 5.impor ...
- 好代码是管出来的——.Net Core集成测试与数据驱动测试
软件的单元测试关注是的软件最小可执行单元是否能够正常执行,但是软件是由一个个最小执行单元组成的集合体,单元与单元之间存在着种种依赖或联系,所以在软件开发时仅仅确保最小单元的正确往往是不够的,为了保证软 ...
- Failure sending mail: The user or group name 'xxx\xxxx' is not recognized.Mail will not be resent
一批Reporting Service报表的订阅突然报如下错误: Failure sending mail: The user or group name 'xxx\xxxx' is not re ...
- PIC单片机基础1
1.PIC单片机总线结构——哈佛结构:即指令和数据空间是完全分开的,所以与常见的微控制器不同的一点是,程序和数据总线可以采用不同的宽度.以PIC16F684单片机为例,数据总线是8位的,但指令总线位数 ...