본문 바로가기

리눅스

[리눅스] Ubuntu 환경에서 Filebeat 설치하는 방법

728x90

Ubuntu 환경에서 Filebeat 설치하는 방법

패키지 저장소 업데이트

sudo apt-get update

Filebeat 패키지 설치

apt-get install -y filebeat
$ cat /etc/filebeat/filebeat.yml | egrep -v '^$|#'
filebeat.inputs:
- type: filestream
  id: my-filestream-id
  enabled: false
  paths:
    - /var/log/*.log
filebeat.config.modules:
  path: ${path.config}/modules.d/*.yml
  reload.enabled: false
setup.template.settings:
  index.number_of_shards: 1
setup.kibana:
output.elasticsearch:
  hosts: ["localhost:9200"]
processors:
  - add_host_metadata:
      when.not.contains.tags: forwarded
  - add_cloud_metadata: ~
  - add_docker_metadata: ~
  - add_kubernetes_metadata: ~

Filebeat 설정 파일을 편집

vim /etc/filebeat/filebeat.yml
output.elasticsearch:
  hosts: ["your_elasticsearch_host:9200"]

filebeat.inputs:
- type: log
  enabled: true
  paths:
    - /path/to/your/logs/*.log
systemctl --now enable filebeat.service
systemctl status filebeat.service

 

참고URL

- filebeat 설치하는 방법 : https://www.elastic.co/guide/en/beats/filebeat/8.6/setup-repositories.html

 

728x90