Diese Präsentation wurde erfolgreich gemeldet.
Die SlideShare-Präsentation wird heruntergeladen. ×

Scrivere e leggere log con elastic

Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Nächste SlideShare
PHP on the desktop
PHP on the desktop
Wird geladen in …3
×

Hier ansehen

1 von 22 Anzeige

Weitere Verwandte Inhalte

Ähnlich wie Scrivere e leggere log con elastic (20)

Weitere von Massimiliano Arione (20)

Anzeige

Aktuellste (20)

Scrivere e leggere log con elastic

  1. 1. Scrivere e leggere log con Elastic Roma 26 aprile 2016
  2. 2. naming things... Lo stack ELK Lo stack Elastic
  3. 3. log
  4. 4. log
  5. 5. Problemi con i classici file di log 1. sono destrutturati 2. sono sparsi sul filesystem 3. possono essere sparsi su macchine diverse 4. possono essere sparsi su N macchine 5. potrebbero essere molto grandi e contenere info di dominio
  6. 6. logstash https://www.elastic.co/products/logstash Process Any Data, From Any Source ● centralizzare il processamento dei dati ● normalizzare schemi e formati ● estendere su formati personalizzati ● aggiungere facilmente plugin
  7. 7. Installazione di logstash wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt- key add - echo "deb http://packages.elastic.co/elasticsearch/2.x/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list sudo apt-get update && sudo apt-get install logstash
  8. 8. elasticsearch https://www.elastic.co/products/elasticsearch Actionable Insight at Your Fingers ● Distribuito, scalabile, ad alta disponibilità ● Ricerche e analisi in tempo reale ● API RESTful
  9. 9. Installazione di elasticsearch echo "deb http://packages.elastic.co/elasticsearch/2.x/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list sudo apt-get update && sudo apt-get install elasticsearch
  10. 10. Configurazione /etc/logstash/conf.d/logstash.conf input { gelf { type => gelf } } output { elasticsearch { hosts => [‘localhost’] } }
  11. 11. Configurazione /etc/logstash/conf.d/logstash.conf input { file { type => apache-access path => /var/log/apache/access.log } } filter { }
  12. 12. Monolog GelfMessageFormatter / GelfHandler
  13. 13. Symfony monolog: handlers: stash: type: gelf publisher: { hostname: 127.0.0.1 } level: debug formatter: monolog.formatter.gelf_message composer require graylog2/gelf-php
  14. 14. log $this->logger->info(‘fooEvent’, [‘foo’ => ‘bar’, ‘user’ => ‘pippo’]) [2016-04-26 19:16:23] app.INFO: fooEvent {‘foo’: ‘bar’, ‘user’: ‘pippo’} []
  15. 15. Kibana https://www.elastic.co/products/kibana See the Value in Your Data ● Analisi e visualizzazione flessibile ● Sintesi e grafici in tempo reale ● Interfaccia intuitiva per gli utenti ● Cruscotti condisivibili ed embeddabili
  16. 16. Installazione di kibana echo "deb http://packages.elastic.co/kibana/4.4/debian stable main" | sudo tee -a /etc/apt/sources.list.d/kibana.list sudo apt-get update && sudo apt-get install kibana
  17. 17. configurazione # kibana.yml server.port: 5601 server.host: "127.0.0.1"
  18. 18. configurazione <VirtualHost *:80> ServerName kibana.example.org ProxyPass / http://localhost:5601/ ProxyPassReverse / http://localhost:5601/ <Location /> AuthType Basic [...] </Location> </VirtualHost>
  19. 19. http://logstash.openstack.org

×