Packetbeat简介

Packetbeat简介 随笔 第1张

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

抓包示例

Packetbeat简介 随笔 第2张

下载packetbeat

Packetbeat简介 随笔 第3张

抓取elasticsearch的包

①启动elasticsearch

Packetbeat简介 随笔 第4张

 

Packetbeat简介 随笔 第5张

启动packetbeat

配置es.yml

#################### Packetbeat Configuration Example #########################

 

# This file is an example configuration file highlighting only the most common

# options. The packetbeat.full.yml file from the same directory contains all the

# supported options with more comments. You can use it as a reference.

#

# You can find the full configuration reference here:

# https://www.elastic.co/guide/en/beats/packetbeat/index.html

 

#============================== Network device ================================

 

# Select the network interface to sniff the data. On Linux, you can use the

# "any" keyword to sniff on all connected interfaces.

packetbeat.interfaces.device: lo0

 

packetbeat.protocols.http:

  # Configure the ports where to listen for HTTP traffic. You can disable

  # the HTTP protocol by commenting out the list of ports.

  ports: [9200]

  send_request: true  

  include_body_for: ["application/json", "x-www-form-urlencoded"]

 

 

#================================ Outputs =====================================

 

# Configure what outputs to use when sending the data collected by the beat.

# Multiple outputs may be used.

 

#-------------------------- Elasticsearch output ------------------------------

#output.elasticsearch:

  # Array of hosts to connect to.

  #  hosts: ["localhost:9200"]

 

  # Optional protocol and basic auth credentials.

  #protocol: "https"

  #username: "elastic"

  #password: "changeme"

 

output.console:

    pretty: true

 

#================================ Logging =====================================

 

# Sets log level. The default log level is info.

# Available log levels are: critical, error, warning, info, debug

#logging.level: debug

 

# At debug level, you can selectively enable logging only for some components.

# To enable all selectors use ["*"]. Examples of other selectors are "beat",

# "publish", "service".

#logging.selectors: ["*"]

 

Packetbeat简介 随笔 第6张

Packetbeat简介 随笔 第7张

启动

Packetbeat简介 随笔 第8张

请求elasticsearch

Packetbeat简介 随笔 第9张

可以看到packetbeat有内容输出

Packetbeat简介 随笔 第10张

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄