Slide 1

Slide 1 text

GrayLog for Java developers Track Monitoring & Cloud José Manuel Ortega

Slide 2

Slide 2 text

@jmortegac

Slide 3

Slide 3 text

Agenda ● Introduction to graylog ● Docker image & compose ● Graylog Architecture ● Connecting with Java ● Connecting with other services

Slide 4

Slide 4 text

GrayLog Open Source Log Management http://www.graylog.org/ http://docs.graylog.org/

Slide 5

Slide 5 text

Graylog features ● Graylog is an open source logs monitor capable of handling messages from different sources: ● Application servers: IBM Websphere, Weblogic, Jboss ● Framework Applications: JAVA EE, NodeJS, Python, C# ● Web Servers: Nginx, Apache

Slide 6

Slide 6 text

Install ● Debian / Ubuntu (deb package) ● RedHat / CentOS (RPM package) ● Virtual Machine (OVA / Vagrant) ● Config management (Chef / Puppet / Ansible) ● Docker image && docker compose

Slide 7

Slide 7 text

https://packages.graylog2.org/appliances/ova

Slide 8

Slide 8 text

Docker images

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

Docker compose

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

Graylog features ● Receives messages from multiple input protocols GELF via HTTP/UDP/TCP, Syslog, Apache Kafka, .... ● Assigns messages to streams ● Triggers user-defined alerts per stream ● Routes messages to different outputs based on streams ● Stores messages in ElasticSearch for graphing ● Uses MongoDB to store metadata and alerts ● Provides search and graphing capabilities for stored messages

Slide 16

Slide 16 text

Graylog features ● Streams: They are message routing mechanisms in categories. ● Alerts: Graylog allows to define alerts that are launched when match with configured conditions. ● Dashboards: Control panel where you can visualize everything that happens in the monitored systems. ● Searches: Graylog provides a search system on the historical from where to locate the messages that help to react before problems. ● Security: Allows you to set permissions to users to restrict the access, display and search for messages.

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

ElasticSearch indexes

Slide 19

Slide 19 text

ElasticSearch indexes

Slide 20

Slide 20 text

Inputs

Slide 21

Slide 21 text

Streams ● Incoming messages can be grouped ● Can be used for to assign user permissions ● Stream alerts can send out notifications

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

GrayLog architecture

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

Connecting with Java

Slide 32

Slide 32 text

Sending log data to graylog ● Syslog – TCP, TCP+TLS, UDP, AMQP, Kafka ● GELF – TCP, TCP+TLS, UDP, HTTP, AMQP,Kafka ● Raw / Plain Text – TCP, TCP+TLS, UDP, AMQP, Kafka ● Collector – TCP, TCP+TLS

Slide 33

Slide 33 text

GELF ● Graylog Extended Log Format ● Logstash, fluentd, nxlog, Docker, … ● Based in syslog and rsyslog ● JSON based format for sending structured data ● JSON Hash with mandatory fields: ○ host, version, short_message, full_message, timestamp, level

Slide 34

Slide 34 text

GELF document

Slide 35

Slide 35 text

Graylog message inspector

Slide 36

Slide 36 text

No content

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

Jars

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

No content

Slide 43

Slide 43 text

No content

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

LogBack ● https://github.com/pukkaone/logback-gelf ● JDK >= 1.7

Slide 46

Slide 46 text

LogBack

Slide 47

Slide 47 text

LogBack appender

Slide 48

Slide 48 text

GraylogRestInterface

Slide 49

Slide 49 text

GelfMessage

Slide 50

Slide 50 text

Connecting with other services

Slide 51

Slide 51 text

No content

Slide 52

Slide 52 text

No content

Slide 53

Slide 53 text

No content

Slide 54

Slide 54 text

No content

Slide 55

Slide 55 text

No content

Slide 56

Slide 56 text

References ● http://docs.graylog.org/en/2.4/index.html ● https://github.com/Graylog2/graylog-docker ● https://hub.docker.com/r/graylog2/graylog/ ● http://docs.graylog.org/en/2.4/pages/installation/ docker.html ● http://docs.graylog.org/en/2.4/pages/faq.html

Slide 57

Slide 57 text

Thanks! Contact: @jmortegac jmortega.github.io about.me/jmortegac