'beats'에 해당되는 글 14건

  1. 2018.07.25 [Beats] 오랜만에 Filebeat 설치 1
  2. 2016.02.12 [Beats] redis/kafka outputs
  3. 2015.10.27 [Filebeat] 가볍게 사용해 볼까요?
  4. 2015.09.09 [Elastic] Elastic 제품들...

[Beats] 오랜만에 Filebeat 설치

Elastic/Beats 2018. 7. 25. 20:23

설치환경)

AWS EC2

Ubuntu


다운로드)

https://www.elastic.co/kr/downloads/beats/filebeat

https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-6.3.1-linux-x86_64.tar.gz


다운 받으시고 그냥 압축 해제 하시면 됩니다.


tree 는 그냥 제 맥북 기준으로 보여 드립니다.


filebeat-6.3.2-darwin-x86_64

├── LICENSE.txt

├── NOTICE.txt

├── README.md

├── fields.yml

├── filebeat

├── filebeat.reference.yml

├── filebeat.yml

├── kibana

│   ├── 5

│   │   ├── dashboard

│   │   │   ├── 0d3f2380-fa78-11e6-ae9b-81e5311e8cab.json

│   │   │   ├── 26309570-2419-11e7-a83b-d5f4cebac9ff.json

│   │   │   ├── 277876d0-fa2c-11e6-bbd3-29c986c96e5a.json

│   │   │   ├── 5517a150-f9ce-11e6-8115-a7c18106d86a.json

│   │   │   ├── 7fea2930-478e-11e7-b1f0-cb29bac6bf8b.json

│   │   │   ├── Filebeat-Apache2-Dashboard.json

│   │   │   ├── Filebeat-MySQL-Dashboard.json

│   │   │   ├── Filebeat-Nginx-Dashboard.json

│   │   │   ├── Filebeat-Traefik-Dashboard.json

│   │   │   ├── Filebeat-syslog-dashboard.json

│   │   │   ├── ML-Nginx-Access-Remote-IP-Count-Explorer.json

│   │   │   ├── ML-Nginx-Remote-IP-URL-Explorer.json

│   │   │   ├── ML-Traefik-Access-Remote-IP-Count-Explorer.json

│   │   │   ├── ML-Traefik-Remote-IP-URL-Explorer.json

│   │   │   ├── b9163ea0-2417-11e7-a83b-d5f4cebac9ff.json

│   │   │   ├── dfbb49f0-0a0f-11e7-8a62-2d05eaaac5cb.json

│   │   │   └── f693d260-2417-11e7-a83b-d5f4cebac9ff.json

│   │   ├── index-pattern

│   │   │   └── filebeat.json

│   │   ├── search

│   │   │   ├── 0ab87b80-478e-11e7-b1f0-cb29bac6bf8b.json

│   │   │   ├── 4ac0a370-0a11-11e7-8b04-eb22a5669f27.json

│   │   │   ├── 62439dc0-f9c9-11e6-a747-6121780e0414.json

│   │   │   ├── 710043e0-2417-11e7-a83b-d5f4cebac9ff.json

│   │   │   ├── 73613570-4791-11e7-be88-2ddb32f3df97.json

│   │   │   ├── 8030c1b0-fa77-11e6-ae9b-81e5311e8cab.json

│   │   │   ├── Apache2-access-logs.json

│   │   │   ├── Apache2-errors-log.json

│   │   │   ├── Filebeat-MySQL-Slow-log.json

│   │   │   ├── Filebeat-MySQL-error-log.json

│   │   │   ├── Filebeat-Nginx-module.json

│   │   │   ├── Filebeat-Traefik-module.json

│   │   │   ├── ML-Filebeat-Nginx-Access.json

│   │   │   ├── ML-Filebeat-Traefik-Access.json

│   │   │   ├── Syslog-system-logs.json

│   │   │   ├── b6f321e0-fa25-11e6-bbd3-29c986c96e5a.json

│   │   │   ├── c876e6a0-2418-11e7-a83b-d5f4cebac9ff.json

│   │   │   ├── eb0039f0-fa7f-11e6-a1df-a78bd7504d38.json

│   │   │   └── ffaf5a30-2413-11e7-a0d9-39604d45ca7f.json

│   │   └── visualization

│   │       ├── 0bc34b60-2419-11e7-a83b-d5f4cebac9ff.json

│   │       ├── 12667040-fa80-11e6-a1df-a78bd7504d38.json

│   │       ├── 2bb0fa70-0a11-11e7-9e84-43da493ad0c7.json

│   │       ├── 2cf77780-2418-11e7-a83b-d5f4cebac9ff.json

│   │       ├── 341ffe70-f9ce-11e6-8115-a7c18106d86a.json

│   │       ├── 346bb290-fa80-11e6-a1df-a78bd7504d38.json

│   │       ├── 3cec3eb0-f9d3-11e6-8a3e-2b904044ea1d.json

│   │       ├── 51164310-fa2b-11e6-bbd3-29c986c96e5a.json

│   │       ├── 5c7af030-fa2a-11e6-bbd3-29c986c96e5a.json

│   │       ├── 5dd15c00-fa78-11e6-ae9b-81e5311e8cab.json

│   │       ├── 5ebdbe50-0a0f-11e7-825f-6748cda7d858.json

│   │       ├── 6295bdd0-0a0e-11e7-825f-6748cda7d858.json

│   │       ├── 78b74f30-f9cd-11e6-8115-a7c18106d86a.json

│   │       ├── 78b9afe0-478f-11e7-b1f0-cb29bac6bf8b.json

│   │       ├── Apache2-access-unique-IPs-map.json

│   │       ├── Apache2-browsers.json

│   │       ├── Apache2-error-logs-over-time.json

│   │       ├── Apache2-operating-systems.json

│   │       ├── Apache2-response-codes-of-top-URLs.json

│   │       ├── Apache2-response-codes-over-time.json

│   │       ├── Errors-over-time.json

│   │       ├── ML-Nginx-Access-Map.json

│   │       ├── ML-Nginx-Access-Remote-IP-Timechart.json

│   │       ├── ML-Nginx-Access-Response-Code-Timechart.json

│   │       ├── ML-Nginx-Access-Top-Remote-IPs-Table.json

│   │       ├── ML-Nginx-Access-Top-URLs-Table.json

│   │       ├── ML-Nginx-Access-Unique-Count-URL-Timechart.json

│   │       ├── ML-Traefik-Access-Map.json

│   │       ├── ML-Traefik-Access-Remote-IP-Timechart.json

│   │       ├── ML-Traefik-Access-Response-Code-Timechart.json

│   │       ├── ML-Traefik-Access-Top-Remote-IPs-Table.json

│   │       ├── ML-Traefik-Access-Top-URLs-Table.json

│   │       ├── ML-Traefik-Access-Unique-Count-URL-Timechart.json

│   │       ├── MySQL-Error-logs-levels.json

│   │       ├── MySQL-Slow-logs-by-count.json

│   │       ├── MySQL-Slow-queries-over-time.json

│   │       ├── MySQL-error-logs.json

│   │       ├── MySQL-slowest-queries.json

│   │       ├── New-Visualization.json

│   │       ├── Nginx-Access-Browsers.json

│   │       ├── Nginx-Access-Map.json

│   │       ├── Nginx-Access-OSes.json

│   │       ├── Nginx-Access-Response-codes-by-top-URLs.json

│   │       ├── Sent-sizes.json

│   │       ├── Syslog-events-by-hostname.json

│   │       ├── Syslog-hostnames-and-processes.json

│   │       ├── Traefik-Access-Browsers.json

│   │       ├── Traefik-Access-Map.json

│   │       ├── Traefik-Access-OSes.json

│   │       ├── Traefik-Access-Response-codes-by-top-URLs.json

│   │       ├── a59b5e00-2417-11e7-a83b-d5f4cebac9ff.json

│   │       ├── c5411910-0a87-11e7-8b04-eb22a5669f27.json

│   │       ├── d16bb400-f9cc-11e6-8115-a7c18106d86a.json

│   │       ├── d1726930-0a7f-11e7-8b04-eb22a5669f27.json

│   │       ├── d2864600-478f-11e7-be88-2ddb32f3df97.json

│   │       ├── d56ee420-fa79-11e6-a1df-a78bd7504d38.json

│   │       ├── d8e5dc40-2417-11e7-a83b-d5f4cebac9ff.json

│   │       ├── dc589770-fa2b-11e6-bbd3-29c986c96e5a.json

│   │       ├── dcccaa80-4791-11e7-be88-2ddb32f3df97.json

│   │       ├── e121b140-fa78-11e6-a1df-a78bd7504d38.json

│   │       ├── f398d2f0-fa77-11e6-ae9b-81e5311e8cab.json

│   │       └── fb09d4b0-2418-11e7-a83b-d5f4cebac9ff.json

│   └── 6

│       ├── dashboard

│       │   ├── Filebeat-Kafka-overview.json

│       │   ├── Filebeat-Mongodb-overview.json

│       │   ├── Filebeat-Postgresql-overview.json

│       │   ├── Filebeat-Postgresql-slowlogs.json

│       │   ├── Filebeat-apache2.json

│       │   ├── Filebeat-auditd.json

│       │   ├── Filebeat-auth-sudo-commands.json

│       │   ├── Filebeat-icinga-debug-log.json

│       │   ├── Filebeat-icinga-main-log.json

│       │   ├── Filebeat-icinga-startup-errors.json

│       │   ├── Filebeat-iis.json

│       │   ├── Filebeat-logstash-log.json

│       │   ├── Filebeat-logstash-slowlog.json

│       │   ├── Filebeat-mysql.json

│       │   ├── Filebeat-new-users-and-groups.json

│       │   ├── Filebeat-nginx-logs.json

│       │   ├── Filebeat-nginx-overview.json

│       │   ├── Filebeat-redis.json

│       │   ├── Filebeat-ssh-login-attempts.json

│       │   ├── Filebeat-syslog.json

│       │   ├── Filebeat-traefik-overview.json

│       │   ├── ml-nginx-access-remote-ip-count-explorer.json

│       │   ├── ml-nginx-remote-ip-url-explorer.json

│       │   ├── ml-traefik-access-remote-ip-count-explorer.json

│       │   ├── ml-traefik-remote-ip-url-explorer.json

│       │   ├── osquery-compliance.json

│       │   └── osquery-rootkit.json

│       └── index-pattern

│           └── filebeat.json

├── module

│   ├── apache2

│   │   ├── access

│   │   │   ├── config

│   │   │   │   └── access.yml

│   │   │   ├── ingest

│   │   │   │   └── default.json

│   │   │   └── manifest.yml

│   │   ├── error

│   │   │   ├── config

│   │   │   │   └── error.yml

│   │   │   ├── ingest

│   │   │   │   └── pipeline.json

│   │   │   └── manifest.yml

│   │   └── module.yml

│   ├── auditd

│   │   ├── log

│   │   │   ├── config

│   │   │   │   └── log.yml

│   │   │   ├── ingest

│   │   │   │   └── pipeline.json

│   │   │   └── manifest.yml

│   │   └── module.yml

│   ├── icinga

│   │   ├── debug

│   │   │   ├── config

│   │   │   │   └── debug.yml

│   │   │   ├── ingest

│   │   │   │   └── pipeline.json

│   │   │   └── manifest.yml

│   │   ├── main

│   │   │   ├── config

│   │   │   │   └── main.yml

│   │   │   ├── ingest

│   │   │   │   └── pipeline.json

│   │   │   └── manifest.yml

│   │   ├── module.yml

│   │   └── startup

│   │       ├── config

│   │       │   └── startup.yml

│   │       ├── ingest

│   │       │   └── pipeline.json

│   │       └── manifest.yml

│   ├── iis

│   │   ├── access

│   │   │   ├── config

│   │   │   │   └── iis-access.yml

│   │   │   ├── ingest

│   │   │   │   └── default.json

│   │   │   └── manifest.yml

│   │   └── error

│   │       ├── config

│   │       │   └── iis-error.yml

│   │       ├── ingest

│   │       │   └── default.json

│   │       └── manifest.yml

│   ├── kafka

│   │   ├── log

│   │   │   ├── config

│   │   │   │   └── log.yml

│   │   │   ├── ingest

│   │   │   │   └── pipeline.json

│   │   │   └── manifest.yml

│   │   └── module.yml

│   ├── logstash

│   │   ├── log

│   │   │   ├── config

│   │   │   │   └── log.yml

│   │   │   ├── ingest

│   │   │   │   ├── pipeline-json.json

│   │   │   │   └── pipeline-plain.json

│   │   │   └── manifest.yml

│   │   ├── module.yml

│   │   └── slowlog

│   │       ├── config

│   │       │   └── slowlog.yml

│   │       ├── ingest

│   │       │   ├── pipeline-json.json

│   │       │   └── pipeline-plain.json

│   │       └── manifest.yml

│   ├── mongodb

│   │   ├── log

│   │   │   ├── config

│   │   │   │   └── log.yml

│   │   │   ├── ingest

│   │   │   │   └── pipeline.json

│   │   │   └── manifest.yml

│   │   └── module.yml

│   ├── mysql

│   │   ├── error

│   │   │   ├── config

│   │   │   │   └── error.yml

│   │   │   ├── ingest

│   │   │   │   └── pipeline.json

│   │   │   └── manifest.yml

│   │   ├── module.yml

│   │   └── slowlog

│   │       ├── config

│   │       │   └── slowlog.yml

│   │       ├── ingest

│   │       │   └── pipeline.json

│   │       └── manifest.yml

│   ├── nginx

│   │   ├── access

│   │   │   ├── config

│   │   │   │   └── nginx-access.yml

│   │   │   ├── ingest

│   │   │   │   └── default.json

│   │   │   ├── machine_learning

│   │   │   │   ├── datafeed_low_request_rate.json

│   │   │   │   ├── datafeed_remote_ip_request_rate.json

│   │   │   │   ├── datafeed_remote_ip_url_count.json

│   │   │   │   ├── datafeed_response_code.json

│   │   │   │   ├── datafeed_visitor_rate.json

│   │   │   │   ├── low_request_rate.json

│   │   │   │   ├── remote_ip_request_rate.json

│   │   │   │   ├── remote_ip_url_count.json

│   │   │   │   ├── response_code.json

│   │   │   │   └── visitor_rate.json

│   │   │   └── manifest.yml

│   │   ├── error

│   │   │   ├── config

│   │   │   │   └── nginx-error.yml

│   │   │   ├── ingest

│   │   │   │   └── pipeline.json

│   │   │   └── manifest.yml

│   │   └── module.yml

│   ├── osquery

│   │   ├── module.yml

│   │   └── result

│   │       ├── config

│   │       │   └── result.yml

│   │       ├── ingest

│   │       │   └── pipeline.json

│   │       └── manifest.yml

│   ├── postgresql

│   │   ├── log

│   │   │   ├── config

│   │   │   │   └── log.yml

│   │   │   ├── ingest

│   │   │   │   └── pipeline.json

│   │   │   └── manifest.yml

│   │   └── module.yml

│   ├── redis

│   │   ├── log

│   │   │   ├── config

│   │   │   │   └── log.yml

│   │   │   ├── ingest

│   │   │   │   └── pipeline.json

│   │   │   └── manifest.yml

│   │   ├── module.yml

│   │   └── slowlog

│   │       ├── config

│   │       │   └── slowlog.yml

│   │       ├── ingest

│   │       │   └── pipeline.json

│   │       └── manifest.yml

│   ├── system

│   │   ├── auth

│   │   │   ├── config

│   │   │   │   └── auth.yml

│   │   │   ├── ingest

│   │   │   │   └── pipeline.json

│   │   │   └── manifest.yml

│   │   ├── module.yml

│   │   └── syslog

│   │       ├── config

│   │       │   └── syslog.yml

│   │       ├── ingest

│   │       │   └── pipeline.json

│   │       └── manifest.yml

│   └── traefik

│       ├── access

│       │   ├── config

│       │   │   └── traefik-access.yml

│       │   ├── ingest

│       │   │   └── pipeline.json

│       │   ├── machine_learning

│       │   │   ├── datafeed_low_request_rate.json

│       │   │   ├── datafeed_remote_ip_request_rate.json

│       │   │   ├── datafeed_remote_ip_url_count.json

│       │   │   ├── datafeed_response_code.json

│       │   │   ├── datafeed_visitor_rate.json

│       │   │   ├── low_request_rate.json

│       │   │   ├── remote_ip_request_rate.json

│       │   │   ├── remote_ip_url_count.json

│       │   │   ├── response_code.json

│       │   │   └── visitor_rate.json

│       │   ├── manifest.yml

│       │   └── tests

│       │       ├── test.log

│       │       └── test.log-expected.json

│       └── module.yml

└── modules.d

    ├── apache2.yml.disabled

    ├── auditd.yml.disabled

    ├── icinga.yml.disabled

    ├── iis.yml.disabled

    ├── kafka.yml.disabled

    ├── logstash.yml.disabled

    ├── mongodb.yml.disabled

    ├── mysql.yml.disabled

    ├── nginx.yml.disabled

    ├── osquery.yml.disabled

    ├── postgresql.yml.disabled

    ├── redis.yml.disabled

    ├── system.yml.disabled

    └── traefik.yml.disabled


97 directories, 254 files


도움말)

Usage:

  filebeat [flags]

  filebeat [command]


Available Commands:

  export      Export current config or index template

  help        Help about any command

  keystore    Manage secrets keystore

  modules     Manage configured modules

  run         Run filebeat

  setup       Setup index template, dashboards and ML jobs

  test        Test config

  version     Show current version info


Flags:

  -E, --E setting=value      Configuration overwrite

  -M, --M setting=value      Module configuration overwrite

  -N, --N                    Disable actual publishing for testing

  -c, --c string             Configuration file, relative to path.config (default "filebeat.yml")

      --cpuprofile string    Write cpu profile to file

  -d, --d string             Enable certain debug selectors

  -e, --e                    Log to stderr and disable syslog/file output

  -h, --help                 help for filebeat

      --httpprof string      Start pprof http server

      --memprofile string    Write memory profile to this file

      --modules string       List of enabled modules (comma separated)

      --once                 Run filebeat only once until all harvesters reach EOF

      --path.config string   Configuration path

      --path.data string     Data path

      --path.home string     Home path

      --path.logs string     Logs path

      --setup                Load sample Kibana dashboards and setup Machine Learning

      --strict.perms         Strict permission checking on config files (default true)

  -v, --v                    Log at INFO level


Use "filebeat [command] --help" for more information about a command.


filebeat.yml 예제)

filebeat:

  prospectors:

    -

      paths:

        - /mnt/apps/apache-tomcat/logs/catalina.out

      encoding: utf-8

      input_type: log


      exclude_lines: ['DEBUG', 'INFO']

      include_lines: ['(E|e)rror', 'ERROR', '(E|e)xception', 'EXCEPTION']


      document_type: error-log


      ignore_older: 5m


      scan_frequency: 10s


      multiline:

        pattern: '^[[:space:]]+|^Caused by:'

        negate: false

        match: after

        max_lines: 10

        timeout: 5s


      tail_files: true


      backoff: 1s

      max_backoff: 10s

      backoff_factor: 2


  registry_file: /mnt/config/filebeat/.filebeat-tomcat


output:

  logstash:

    hosts: ["localhost:5044"]


shipper:


logging:

  to_syslog: false

  to_files: true


  level: warning


  files:

    path: /mnt/logs/filebeat

    name: filebeat-tomcat.log

    rotateeverybytes: 10485760 # = 10MB


logstash 예제)

input {

  beats {

    port => 5044

  }

}


output {

  stdout { codec => rubydebug }


  http {

    url => "https://slack.com/api/chat.postMessage"

    content_type => "application/json"

    http_method => "post"

    format => "json"

    mapping => [ "channel", "slack-bot", "text", "%{message}" ]

    headers => ["Authorization", "Bearer xoxb-XXXXXXXXXXXXXXXXXXXXX"]

  }

#  elasticsearch {

#    host => "localhost"

#    port => "9200"

#    protocol => "http"

#    index => "%{[@metadata][index]}"

#    document_type => "%{[@metadata][type]}"

#  }

}


위 예제는 그냥 filebeat 이 log file 을 리스닝 하고 있다가 error 또는 exception 발생 시 바로 slack 으로 해당 에러는 보내주는 예제 입니다.

:

[Beats] redis/kafka outputs

Elastic/Beats 2016. 2. 12. 11:08

beats 1.1.0 이 릴리즈 되면서 공지된 내용입니다.


원본링크)


내용요약)

[ASIS]

Beats -> Logstash -> Redis -> Logstash -> Elasticsearch


[TOBE]

Beats -> Redis/Kafka -> Logstash -> Elasticsearch


beats 랑 logstash는 매우 비슷한 기능을 제공하고 있습니다.

아마도 elastic 내부에서도 고민이 될 것 같기도 한데요.

beats 와 logstash 를 다 사용해본 개인적 입장에서는 각각의 특성에 맞춰 사용하면 되지 싶습니다.

단순하게 비교하면 성능은 beats 가 좋은것 같고 다양성과 활용도 측면에서는 logstash가 좋은것 같습니다.


:

[Filebeat] 가볍게 사용해 볼까요?

Elastic/Beats 2015. 10. 27. 15:13
filebeat 가 릴리즈 되었습니다.
▶ elastic blog : https://www.elastic.co/blog/weekly-beats-first-filebeat-release

GA 버전은 아니고 beta4 이지만 그래도 의미 있는 릴리즈이기 때문에 소식을 전하지 않았나 싶습니다.

여기서는 가볍게 FEL (Filebeat + Elasticsearch + Logstash) 구성으로 /var/log 아래 파일로그에 대한 수집과 색인까지 살펴 보도록 하겠습니다.


Kibana를 이용한 dashboard 구성은 제가 직접 만들면 되는데 귀찮아서 그냥 이건 skip 하도록 하겠습니다.

기본적으로 elastic에서 제공하고 있는 dashboard sample 데이터가 있으니 참고 하시면 좋을 것 같습니다.

(2015.10.27일 기준으로 filebeat 는 등록되어 있지 않습니다.)


▶ elastic reference : https://www.elastic.co/guide/en/beats/libbeat/current/getting-started.html#load-kibana-dashboards


curl -L -O http://download.elastic.co/beats/dashboards/beats-dashboards-1.0.0-beta4.tar.gz

tar xzvf beats-dashboards-1.0.0-beta4.tar.gz

cd beats-dashboards-1.0.0-beta4/

./load.sh


[FEL Architecture]

기본적인 아키텍쳐링은 elastic 문서에 잘 나와 있습니다.



[Filebeat 란?]

filebeat는 기본적으로 logstash forwarder를 기반으로 만들어 졌습니다.

개별 노드에 agent 형태로 설치가 되어 동작 하게 되며, log directories or specific log files, tails the files 에 대해서 elasticsearch로 색인하게 됩니다.


참고 문서)

* "logstash-forwarder" : https://github.com/elastic/logstash-forwarder

* "libbeat platform" : https://www.elastic.co/guide/en/beats/libbeat/current/index.html


[Filebeat 설치]

※ 개발 장비로 macbook 을 사용중이기 때문에 mac 기준으로 작성 합니다.


Step 1) 다운로드를 받고 압축을 해제 합니다.

다운로드 링크 : https://www.elastic.co/downloads/beats/filebeat

$ tar -xvzf filebeat-1.0.0-beta4-darwin.tgz

$ cd filebeat-1.0.0-beta4-darwin

$ vi filebeat.yml


Step 2) filebeat.yml 설정
 filebeat configure : https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-configuration-details.html
filebeat도 elasticsearch와 마찬가지로 잘 모르면 기본 설정으로 사용 하시면 됩니다.
기본적으로 설정 하셔야 하는 값들은 "paths", "log", "elasticsearch", "logstash" 설정입니다.

...중략...
      paths:
        - /var/log/*.log

      type: log
...중략...
output:

  ### Elasticsearch as output
  elasticsearch:

    # Set to true to enable elasticsearch output
    enabled: false

...중략...

  logstash:

    # Uncomment out this option if you want to output to Logstash. The default is false.

    enabled: true


    # The Logstash hosts

    hosts: ["localhost:5044"]

...중략...


※ 여기서 elasticsearch.enabled: false 로 하는 것은 F -> L -> E 구조로 사용하기 위해서 입니다.


 filebeat logstash output configure : https://www.elastic.co/guide/en/beats/libbeat/master/configuration.html#logstash-output


Step 3) dynamic template 설정

이 설정은 logstash를 사용해 보신 분이라면 어떤 용도인지 잘 아실거라고 생각 합니다.

짧게 설명 드리면 dynamic mapping에 의한 특정 index 패턴에 사전 mapping 구성을 통해 생성되는 field의 특성을 pre-define 하는 설정을 하는 것입니다.


$ curl -XPUT 'http://localhost:9200/_template/filebeat?pretty' -d@filebeat.template.json

※ filebeat.template.json 파일은 압축 해제 하신 경로에 포함되어 있습니다.


Step 4) filebeat 실행

※ elasticsearch와 logstash를 먼저 실행 시켜 둔 후 아래 명령어로 실행 합니다.


$ sudo ./filebeat -e -c filebeat.yml -d "publish"


[Logstash 구성]

  1. filebeat 데이터를 받아 줄 logstash를 구성 합니다.
  2. logstash 1.5.4 이상
  3. beats plugin 설치
    $ bin/plugin install logstash-input-beats

[Filebeat용 logstash config 생성]

아래 설정은 libbeat reference 문서에 자세히 나와 있습니다.

 libbeat reference : https://www.elastic.co/guide/en/beats/libbeat/current/getting-started.html

input {

  beats {

    port => 5044

  }

}


output {

  elasticsearch {

    host => "localhost"

    port => "9200"

    protocol => "http"

    index => "%{[@metadata][index]}"

    document_type => "%{[@metadata][type]}"

  }

}


아래 그림은 제 맥북에서 실행 시킨 명령어 스크린샷 입니다.



logstash) bin/logstash -f conf/filebeat.config

filebeat) sudo ./filebeat -e -c filebeat.yml -d "publish"

kibana) bin/kibana

elasticsearch) bin/elasticsearch


간단하게 요약을 하면 이렇습니다.)


1. 수집 할 대상 서버에 filebeat 를 설치하고 실행 합니다.

2. logstash input beat 를 실행하고 output 으로 elasticsearch로 색인 되도록 합니다.

3. elasticsearch에 적재된 로그를 기반으로 kibana에서 dashboard를 구성 합니다.


:

[Elastic] Elastic 제품들...

Elastic 2015. 9. 9. 10:30

Elasticsearch, Logstash, Kibana 를 주로 사용하고 있다 보니 다른 제품들은 크게 관심있게 보지를 않았습니다.

제가 관심 있게 보는건 저 한테 필요 하거나 오픈소스 이거나 인데요.

당연히 위에 제품들은 모두 제가 사용하고 있는 것들이고 오픈소스 입니다.


Elastic 에서 제공하고 있는 제품들은 아래 링크를 통해서 확인 하시면 되는데요.


제품 소개 링크) https://www.elastic.co/products


최근까지 제가 잘 못 알고 있던 제품이 있었는데 이것도 한번 사용해 보기 위해 elastic 제품들을 각각 한 줄로 정리해 보기로 했습니다.


Elasticsearch - 오픈소스 무료

루씬 기반의 분산 검색 엔진 입니다.


Logstash - 오픈소스 무료

다양한 input/filter/ouput/codec 들을 제공하는 collector 입니다.


Kibana - 오픈소스 무료

elasticsearch를 DB로 사용하는 visualization/dashboard 도구 입니다.


Packet Beat - 오픈소스 무료

OS 또는 Process 등에서 발생 하는 network 모니터링 도구 입니다.


Top Beat - 오픈소스 무료

기본적인 시스템(CPU, MEM, IO, DISK) 모니터링 도구 입니다.


Elasticsearch Hadoop Plugin - 오픈소스 무료

Hadoop component 들과 elasticsearch를 쉽게 연동 할 수 있도록 도와 주는 라이브러리 입니다.


Found - SaaS 형 서비스 유료

Cloud 환경에서 ELK 를 쉽게 구축하고 사용할 수 있도록 해주는 서비스 입니다.


Shield - 유료

ELK를 이용하여 기업에서 사용하기에는 부족했던 인증, 권한 등의 기능을 제공해 주는 제품 입니다.


Watcher - 유료

ELK를 이용하면서 아쉬웠던 alert 이나 notification 에 대한 기능을 제공해 주는 제품 입니다.


Marvel - 유료 (개발자 버전은 무료)

Elasticsearch에 대한 관리 및 모니터링을 제공하는 제품 입니다.


저는 기본적으로 ELK 기반으로 필요한건 다 만들어서 사용을 하고 있는 편입니다.

beats 도 역시 만들어서 사용하고 있었는데요. 

이건 한번 시도를 해봐야 겠내요. :)

: