Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

The CD stack sends the Jenkins console output directly to Elasticsearch using the logstash plugin. For this reason scripted fields are used in Kibana to parse and derive fields on load time instead of using logstash.

The instructions to configure these fields and import the dashboard are as follows:

  1. Update mappings to support using message.keyword field. 
    To do so on the Elasticsearch (ES) node run the following curl command included in the attached file:
    jenkins_elasticsearch_mappings.txt
  2. Add the following parameter to the elasticsearch.yml config file:
    script.painless.regex.enabled: true
  3. Restart ES

  4. In Kibana create the index patter "logstash-jenkins". Set the timestamp field to "@buildTimestamp"
  5. For that index pattern navigate to the scripted fields tab. Create a scripted field named "healthcheck". Language is painless. Type is string. Script is as follows:
    def msg = doc['message.keyword'].value;
    if (doc['message.keyword'].value != null) {
    if (doc['message.keyword'].value =~ /Health Check/) {
    if (doc['message.keyword'].value =~ /PASS/) {
    return "PASS";
    }
    else {
    return "FAIL";
    }
    }
    }
  6. Create another scripted field named "component". Language is painless. Type is string. Script is as follows:
    def msg = doc['message.keyword'].value;
    if (doc['message.keyword'].value != null) {
    if (doc['message.keyword'].value =~ /Health Check/) {
    if (doc['message.keyword'].value =~ /PASS/) {
    return "PASS";
    }
    else {
    return "FAIL";
    }
    }
    }
  7. Import the following visualizations to Kibana:
    jenkins cd visualizations.json

  8. Import the following dashboard to Kibana:
    jenkins cd dashboard.json


  • No labels