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

输出验证

相关推荐
鸿蒙布道师7 分钟前
宇树科技安全漏洞揭示智能机器人行业隐忧
运维·网络·科技·安全·机器学习·计算机视觉·机器人
matrixlzp12 分钟前
Nginx 源码安装成服务
nginx·云原生
朱四龙1 小时前
http接口性能优化方案
网络协议·http·性能优化
爱学习的章鱼哥2 小时前
计算机网络|| 路由器和交换机的配置
网络·计算机网络·智能路由器
互联科技报2 小时前
声网对话式AI用于在线辅导,体验超出预期
网络
Aric_Jones4 小时前
lua入门语法,包含安装,注释,变量,循环等
java·开发语言·git·elasticsearch·junit·lua
Hello.Reader4 小时前
ngx_http_limit_conn_module精准连接控制
网络·网络协议·http
qq_386322695 小时前
华为网路设备学习-21 IGP路由专题-路由过滤(filter-policy)
前端·网络·学习
张青贤6 小时前
K8s中的containerPort与port、targetPort、nodePort的关系:
云原生·容器·kubernetes
巴巴_羊8 小时前
前端面经 计网 http和https区别
网络协议·http·https