zoukankan      html  css  js  c++  java
  • ELK之使用packetbeat分析网络包流量

      介绍

      packbeat是一个开源的实时网络抓包与分析框架,内置了很多常见的协议捕获及解析,如HTTP、MySQL、Redis等。在实际使用中,通常和Elasticsearch以及kibana联合使用,用于数据搜索和分析以及数据展示。

      目前Packebeat支持的协议如下:

    ICMP (v4 and v6)
    
    DNS
    
    HTTP
    
    Mysql
    
    PostgreSQL
    
    Redis
    
    Thrift-RPC
    
    MongoDB
    
    Memcache
    

      Packetbeat可以运行在应用服务器上或者独自的服务器。当运行在独自服务器上时,需要从交换机的镜像端口或者窃听设备上获取网络流量。

      安装系统环境查看

      下载rpm包安装

    rpm -vih packetbeat-6.6.2-x86_64.rpm
    

      修改配置文件

     /etc/packetbeat/packetbeat.yml
    

      

    packetbeat.interfaces.device: eth0
    packetbeat.flows:
      timeout: 30s
      period: 10s
    packetbeat.protocols:
    - type: icmp
      enabled: true
    - type: amqp
      ports: [5672]
    - type: cassandra
      ports: [9042]
    - type: dhcpv4
      ports: [67, 68]
    - type: dns
      ports: [53]
      include_authorities: true
      include_additionals: true
    - type: http
      ports: [80, 8080, 8000, 5000, 8002]
    - type: memcache
      ports: [11211]
    - type: mysql
      ports: [3306]
    - type: pgsql
      ports: [5432]
    - type: redis
      ports: [6379]
    - type: thrift
      ports: [9090]
    - type: mongodb
      ports: [27017]
    - type: nfs
      ports: [2049]
    - type: tls
      ports: [443]
    setup.template.settings:
      index.number_of_shards: 3
    setup.kibana:
      host: "172.16.90.24:5601"
    output.elasticsearch:
      hosts: ["172.16.90.24:9200"]
    processors:
      - add_host_metadata: ~
      - add_cloud_metadata: ~
    

      导入kibana模板

    packetbeat setup --dashboards
    

      kibana查看

     

  • 相关阅读:
    怎么把自己电脑上的文件传到服务器本地上
    查看hive中某个表中的数据、表结构及所在路径
    python2.7读汉字的时候出现乱码,如何解决
    如何连接服务器客户端
    java常用问题排查工具
    netty源码分析之一:server的启动
    java AQS 一:
    netty源码分析之二:accept请求
    java Resource
    二:基础概述netty
  • 原文地址:https://www.cnblogs.com/minseo/p/10729305.html
Copyright © 2011-2022 走看看