linux - logstash 不读取 Metricbeat 数据

标签 linux logstash metricbeat

我已将 Metricbeat 配置为捕获系统级指标,Metricbeat 在 Redhat linux 中作为一项服务安装,我使用 rpm 包安装了 metricbeat。 下面是我的 metricbeat 配置。

> #============================  Config Reloading ==============================
> metricbeat.config.modules:
> 
>   # Glob pattern for configuration reloading
>   path: ${path.config}/conf.d/*.yml
> 
>   # Period on which files under path should be checked for changes
>   reload.period: 10s
> 
>   # Set to true to enable config reloading
>   reload.enabled: false
> 
> # Maximum amount of time to randomly delay the start of a metricset. Use 0 to
> # disable startup delay.
> metricbeat.max_start_delay: 10s
> 
> #------------------------------- System Module -------------------------------
> - module: system
>   metricsets:
>     - cpu             # CPU usage
>     - load            # CPU load averages
>     - memory          # Memory usage
>     - network         # Network IO
>     - process         # Per process metrics
>     - process_summary # Process summary
>     - uptime          # System Uptime
>     #- core           # Per CPU core usage
>     #- diskio         # Disk IO
>     #- filesystem     # File system usage for each mountpoint
>     #- fsstat         # File system summary metrics
>     #- raid           # Raid
>     #- socket         # Sockets and connection info (linux only)
>   enabled: true
>   period: 10s
>   processes: ['.*']
> 
>   # Configure the metric types that are included by these metricsets.
>   cpu.metrics:  ["percentages"]  # The other available options are normalized_percentages and ticks.
>   core.metrics: ["percentages"]  # The other available option is ticks.
> 
> 
> #----------------------------- Logstash output ---------------------------------
> output.logstash:
>   # Boolean flag to enable or disable the output module.
>   #enabled: true
> 
>   # The Logstash hosts
>   hosts: ["localhost:5044"]

并且 logstash 也使用 rpm 包作为服务安装在 Redhat linux 中。

下面是我的 logstash 配置,我试图从中读取输入

beat.input {
beats {
port => 5044
}
}

output {
elasticsearch {
host => "localhost:9200"
index => "metricbeat_logs"
}

}

下面是我对 logstash 和 metricbeat 的用户和组权限

cd/etc/logstash ls -lrt

-rw-------. 1 apelkdev apa 1696 Aug 18 02:29 startup.options
> -rw-r--r--. 1 apelkdev apa  285 Aug 18 02:29 pipelines.yml
> -rw-r--r--. 1 apelkdev apa  342 Aug 18 02:29 logstash-sample.conf
> -rw-r--r--. 1 apelkdev apa 4466 Aug 18 02:29 log4j2.properties
> -rw-r--r--. 1 apelkdev apa 1846 Aug 18 02:29 jvm.options
> -rwxr-xr-x. 1 apelkdev apa 8154 Feb  8 07:41 logstash.yml
> drwxrwxr-x. 2 apelkdev apa 4096 Feb  8 10:29 conf.d

cd/etc/metricbeat ls -lrt

-rw-r--r--. 1 apelkdev apa 57809 Aug 18 00:28 metricbeat.reference.yml
 -rw-r--r--. 1 apelkdev apa 76697 Aug 18 00:28 fields.yml
 -rw-r--r--. 1 apelkdev apa     0 Feb  7 06:24 metricbeat.
 -rw-------. 1 apelkdev apa  7892 Feb  8 08:14 metricbeat.yml

我正在使用波纹管命令运行这两个服务

sudo 服务 metricbeat 启动 sudo 服务 logstash 启动

我真的不明白这里出了什么问题,当我们检查 metricbeat 日志时,它已经捕获了当前时间戳的指标详细信息,不太确定 logstash 发生了什么以及为什么它不读取 metricbeat 事件。

最佳答案

您尚未在代码中启用输出到 logstash。

> output.logstash:
>   # Boolean flag to enable or disable the output module.
>   #enabled: true

上面请改成

启用:真

关于linux - logstash 不读取 Metricbeat 数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54625664/

相关文章:

linux - 如何查看特定日期的备份文件列表

python-3.x - 如何获得 spacy 模型的旧版本?

elasticsearch - Metricbeat 创建大量字段

elasticsearch - 使用 Elasticsearch /kibana/logstash 集中 pm2 日志

elasticsearch - 如何在ElasticSearch中读取最新索引

elasticsearch - http模块中的多个路径 - metricbeats

linux - 限制对脚本运行开关的人的使用

linux - 如何让 "awk"在 "su -c"命令中正常工作?

elasticsearch - 如何使用Logstash将数据从AWS dynamo DB加载到Elasticsearch

authentication - 限制特定仪表板中的某些 kibana 用户