...
- 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 Add the following parameter to the elasticsearch.yml config file:
script.painless.regex.enabled: true
Restart ES
- In Kibana create the index patter "logstash-jenkins". Set the timestamp field to "@buildTimestamp"
- 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";
}
}
} - 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";
}
}
} Import the following visualizations to Kibana:
jenkins cd visualizations.json- Import the following dashboard to Kibana:
jenkins cd dashboard.json