zoukankan      html  css  js  c++  java
  • Filebeat的http endpoint input

    Filebeat的input终于支持了http,可以使用post请求向filebeat的input传输数据,不过现在还是处于beta版本

    参考

    https://www.elastic.co/guide/en/beats/filebeat/7.x/filebeat-input-http_endpoint.html
    

    下载filebeat最新版本,然后解压

    wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.9.2-linux-x86_64.tar.gz
    

    配置 filebeat_http.yml

    filebeat.inputs:
    - type: http_endpoint
      enabled: true
      listen_address: localhost
      listen_port: 19080
    
    #----------------------------------File output--------------------------------#
    output.file:
      path: "/tmp/filebeat"
      filename: filebeat
    

    给配置文件赋权

    chmod go-w ./filebeat_http.yml
    

    启动filebeat

    ./filebeat -e -c filebeat_http.yml
    

    向19080端口发送post请求

    curl -XPOST http://localhost:19080 -H 'Content-Type:application/json' -d'{"a":"b"}'
    {"message": "success"}
    

    不支持get请求

    去/tmp/filebeat中查看

    lintong@lintong-B250M-DS3H:/tmp/filebeat$ tail -n 100 filebeat 
    {"@timestamp":"2020-10-10T09:44:22.294Z","@metadata":{"beat":"filebeat","type":"_doc","version":"7.9.2"},"json":{"a":"b"},"input":{"type":"http_endpoint"},"ecs":{"version":"1.5.0"},"host":{"name":"lintong-B250M-DS3H"},"agent":{"hostname":"lintong-B250M-DS3H","ephemeral_id":"20bf06ed-3421-44b8-aeaf-bb5d54565eb3","id":"78e98f32-c8ce-4505-b75e-c98f373a2205","name":"lintong-B250M-DS3H","type":"filebeat","version":"7.9.2"}}
    
  • 相关阅读:
    [BZOJ 1833] 数字计数
    [Codeforces 23E] Tree
    [Codeforces 23D] Tetragon
    前端基础之CSS
    前端基础之HTML
    youku项目总结(粗略总结)
    MySQL视图、触发器、事务、存储过程、内置函数、流程控制、索引
    MySQL多表查询,Navicat使用,pymysql模块,sql注入问题
    MySQL单表查询
    MySQL表关系--外键
  • 原文地址:https://www.cnblogs.com/tonglin0325/p/13794532.html
Copyright © 2011-2022 走看看