云原生学习 – Filebeat 命令速查手册

一、Filebeat 安装

# 下载
wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.17.29-amd64.deb

# 安装
dpkg -i filebeat-7.17.29-amd64.deb

二、配置文件示例

2.1 标准输入到控制台

filebeat.inputs:
- type: stdin

output.console:
  pretty: true

2.2 采集日志到 ES

filebeat.inputs:
- type: log
  paths:
    - /var/log/nginx/access.log

output.elasticsearch:
  hosts: ["https://10.0.0.91:9200"]
  index: "oldboyedu-filebeat-nginx-%{+yyyy.MM.dd}"

setup.ilm.enabled: false

三、启动命令

# 指定配置文件启动
filebeat -e -c /etc/filebeat/config/01-stdin-to-console.yaml

# 多实例启动 (指定数据目录)
filebeat -e -c /etc/filebeat/config/02-log-to-console.yaml --path.data /tmp/xixi

四、模块管理

# 查看模块
filebeat modules list

# 启用模块
filebeat modules enable nginx tomcat mysql

# 禁用模块
filebeat modules disable mysql

五、数据位置管理

# 默认数据目录
/var/lib/filebeat/

# 重新从头采集
rm -rf /var/lib/filebeat/
filebeat -e -c /etc/filebeat/config/02-log-to-console.yaml

六、快捷命令速查

用途 命令
查看模块 filebeat modules list
启用模块 filebeat modules enable nginx
禁用模块 filebeat modules disable nginx
启动 filebeat -e -c <config.yaml>
多实例 filebeat -e -c <config.yaml> --path.data /tmp/xixi
重新采集 rm -rf /var/lib/filebeat/
记录~
暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇