Build and Release

A continuous learner for experience and life.

Feeding Build Logs Into Elasticsearch With Logstash on Jenkins

enter image description here

Elasticsearch platform is designed to take data from any source and as a build guy, we create a lot of metadata every day, across Android, iOS, Windows platform, such as compiler warnings, errors, lint message, unit test reports, etc. Is it possible to collect such data, then store into Elasticsearch with Logstash plugins, then visualize them with Kibana?

In this article, we setup an Elasticsearch instance very quickly, with the support of elastic cloud, then config the Logstash plugin on Jenkins to feed log data into Elasticsearch space, then display the message with Kibana.

Create elasticsearch instance on elastic cloud:

enter image description here

Install logstash plugin on Jenkins with Plugin Manager:

enter image description here

Config logstash plugin as an agent:

enter image description here

Config logstash for each project:

enter image description here enter image description here

Search message from Kibana Web UI:

enter image description here

Some useful URL to check status of elasticsearch:

Check health of elasticsearch:

1
http://02bb48d4a19b37090ea4ef33d4a4e596.us-west-1.aws.found.io:9200/_cat/health?v

Check indices (tables/contents) on elasticsearch:

1
http://02bb48d4a19b37090ea4ef33d4a4e596.us-west-1.aws.found.io:9200/_cat/indices?v

References:

  1. https://www.elastic.co/cloud
  2. https://wiki.jenkins-ci.org/display/JENKINS/Logstash+Plugin

Written with StackEdit.

Comments