Sunday, 19 June 2022

ELK setup in mac

 Downlaod below for mac with all compatible versions each other:

1.filebeat

2. logstash

3. elastic search

4. kibana


Enable some modules in filebeat to check default logs:

filebeat.yml config:


enable below to send logs via logstash:

output.logstash:

  # The Logstash hosts

  hosts: ["localhost:5044"]


enable below to send logs without logstash:

output.elasticsearch:

  # Array of hosts to connect to.

  hosts: ["localhost:9200"]


add below to integrate new log file in filebeat:

- type: log

  enabled: true

  paths:

    - /Users/...../logs/kibana_log.log



./filebeat modules list

./filebeat modules enable nginx

./filebeat modules enable mysql


sudo chown root filebeat.yml 

sudo chown root modules.d/nginx.yml 

sudo chown root modules.d/mysql.yml 


./filebeat setup -e


sudo ./filebeat -e -c filebeat.yml -strict.perms=false




logstash:

create a sample file in logstash

logstash-simple.conf


input {

beats {

  host => "localhost"

  port => "5044"

  ssl => false

 }

 }


output {

  elasticsearch {

   hosts => ["localhost:9200"]

   index => "app_service"

 }

  stdout { codec => rubydebug }

}


command to start:

logstash -f logstash-simple.conf


elastic

./elasticsearch


kibana

./kibana


create index pattern in kibana:


stackmanegement--> kibana--> dataview--> create dataview-> add name--> choose timestamp if we have.


after created we can see in discover.


links for Data Structure

  1) 𝐁𝐞𝐜𝐨𝐦𝐞 𝐌𝐚𝐬𝐭𝐞𝐫 𝐢𝐧 𝐋𝐢𝐧𝐤𝐞𝐝 𝐋𝐢𝐬𝐭:  https://lnkd.in/gXQux4zj 2) 𝐀𝐥𝐥 𝐭𝐲𝐩𝐞𝐬 𝐨𝐟 𝐓𝐫𝐞𝐞 𝐓𝐫𝐚𝐯𝐞𝐫𝐬𝐚𝐥𝐬...