binary 파일로 on-premise 환경에서 filebeat 구축법을 공유합니다.
docker는 ➡️ (docker_elk)
Filebeat
는 로그 파일, 이벤트 파일, 시스템 로그 등 다양한 유형의 로그 데이터를 모니터링하고, 이를 실시간으로 Elastic Stack의 다른 구성 요소로 전송합니다.Elasticsearch module
을 이용해 log 파싱합니다.filebeat.config.modules:
path: ${MODULE_PATH}
reload.enabled: false
setup.kibana:
host: ${KIBANA_HOST}
protocol: "http"
dashboards.enabled: true
output.elasticsearch:
hosts: [${ES_HOST}]
# Module: elasticsearch
# Docs: https://www.elastic.co/guide/en/beats/filebeat/7.10/filebeat-module-elasticsearch.html
- module: elasticsearch
# Server log
server:
enabled: true
# Set custom paths for the log files. If left empty,
# Filebeat will choose the paths depending on your OS.
var.paths:
- ${ES_LOG_PATH}/*_server.json
audit:
enabled: true
# Set custom paths for the log files. If left empty,
# Filebeat will choose the paths depending on your OS.
var.paths:
- ${ES_LOG_PATH}/*_audit.json
slowlog:
enabled: true
# Set custom paths for the log files. If left empty,
# Filebeat will choose the paths depending on your OS.
var.paths:
- ${ES_LOG_PATH}/*_index_search_slowlog.json
- ${ES_LOG_PATH}/*_index_indexing_slowlog.json
deprecation:
enabled: true
# Set custom paths for the log files. If left empty,
# Filebeat will choose the paths depending on your OS.
var.paths:
- ${ES_LOG_PATH}/*_deprecation.json
# 서비스 활성화
systemctl enable filebeat.service
# 서비스 reload
systemctl daemon-reload
Description=Filebeat sends log files to Logstash or directly to Elasticsearch.
Documentation=https://www.elastic.co/products/beats/filebeat
Wants=network-online.target
After=network-online.target
[Service]
ExecStart=${FILEBEAT_HOME}/filebeat -e -c ${FILEBEAT_HOME}/filebeat.yml
Restart=always
[Install]
WantedBy=multi-user.target
systemctl start filebeat