logstash中的input插件(http插件,graphite插件)

http插件

Logstash 中的 HTTP 输入插件用于通过 HTTP 请求接收数据。它可以让 Logstash 充当一个 HTTP 服务器,接收来自客户端的 JSON、XML 或纯文本格式的数据。

一.安装logstash

Download Filebeat • Lightweight Log Analysis | Elastic3ehttps://www.elastic.co/downloads/beats/filebeat

二.编辑logstash.conf配置文件

bash 复制代码
[root@k8s-master conf.d]# cat http_test.conf 
input {
  http {
    host => "0.0.0.0"
    port => 8080
  }
}

output {
  stdout {
    codec => rubydebug
  }
}

三.运行logstash

bash 复制代码
[root@k8s-master conf.d]# logstash -f /etc/logstash/conf.d/http_test.conf 

四.发送测试数据到 HTTP输入插件

bash 复制代码
[root@k8s-master elastic-agent]# curl -X POST "http://192.168.9.128:8080" -H 'Content-Type: application/json' -d '{"message": "Hello, Logstash!"}'
ok

五.输出验证

graphite插件

Logstash 中的 Graphite 输入插件用于接收来自 Graphite 的指标数据。Graphite 是一个开源监控工具,通常用于收集和存储时间序列数据。

编辑logstash.conf配置文件

bash 复制代码
[root@k8s-master conf.d]# cat graphite.conf 
input {
  graphite {
    host => "0.0.0.0"
    port => 2003
  }
}

output {
  stdout {
    codec => rubydebug
  }
}

发送测试数据

bash 复制代码
[root@k8s-master elastic-agent]# echo "test.metric 42 $(date +%s)" | nc -w1 192.168.9.128 2003

输出验证

相关推荐
MXsoft61825 分钟前
**从设备到业务:如何用业务视角管理IT?**
网络
故渊at26 分钟前
第八板块:Android 网络体系与连接管理 | 第二十二篇:ConnectivityService 与 Netd 网络架构
android·网络·架构·连接管理·connectivity
顾喵33 分钟前
VME总线详解:原理、架构、时序、协议、迭代、调试与实战应用
linux·网络协议
徐寿春1 小时前
什么是 Elasticsearch 倒排索引
大数据·elasticsearch·搜索引擎
Patrick_Wilson1 小时前
从「框架内部报错」到「请求头被网关截断」:一次 Sentry 排障与前端 Cookie 误用复盘
前端·http·浏览器
IT探索1 小时前
服务器 BIOS 测试
运维·服务器·网络
hj2862511 小时前
Rsync 数据同步 + Inotify 实时监控 完整版实操笔记3
linux·运维·网络
尚文网络1 小时前
ACL技术介绍
网络·h3c
深圳维信仪器1 小时前
AEM Testpro CV100-K50E和FLUKE DSX-8000功能是否一样?
网络
薛定猫AI1 小时前
【深度解析】Claude Fable 5 全面评测:安全防护机制、基准测试与实战性能深度拆解
网络·安全