Menu

Showing posts with label filebeat. Show all posts
Showing posts with label filebeat. Show all posts

Thursday, May 16, 2019

[ELK - Logstash] วิธีการ parse ข้อความ Log ที่มีหลายรูปแบบ โดยใช้ GROK
[ELK - Logstash] How to Parse Multiple Log Message by Using GROK

สำหรับการ parse ข้อความโดย GROK คุณต้องเพิ่ม grok filter ตามตัวอย่างด้านล่าง (อ้างอิงจาก https://www.elastic.co/guide/en/logstash/2.1/plugins-filters-grok.html#plugins-filters-grok-match)

สำหรับรายละเอียดของ GROK patterns อ่านได้ที่ https://github.com/elastic/logstash/blob/v1.4.0/patterns/grok-patterns

คุณสามารถทดสอบ pattern ที่คุณสร้างขึ้นกับข้อความจริง ได้ที่ https://grokdebug.herokuapp.com/

Tuesday, April 23, 2019

[ELK - Filebeat] การติดตั้งและตั้งค่า Filebeat บน Ubuntu เพื่อเก็บ log ใน Logstash
[ELK - Filebeat] How to Install and Configure Filebeat on Ubuntu for Storing Log in Logstash

การติดตั้ง Filebeat สามารถทำได้โดยรันคำสั่งดังนี้
curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-6.6.2-amd64.deb
dpkg -i filebeat-6.6.2-amd64.deb
Path ของ Filebeat ที่ควรรู้มีดังนี้
config path/etc/filebeat
log path /var/log/filebeat

กรณีใช้ Filebeat ยิง log ไปที่ Logstash จำเป็นจะต้อง load template ไปที่ elasticsearch แบบ manual โดยใช้คำสั่งดังนี้
filebeat setup --template -E output.logstash.enabled=false -E 'output.elasticsearch.hosts=["localhost:9200"]'