content_image/1005548.jpg content_image/1005556.jpg
<img src='content_image/1005548.jpg'>

Tip:  If the kibana-init pod fails, it’s because it co uld not initialize the default index in Kibana. This is not a problem, as the default index can be set through the Kibana UI. 

6. Retrieve the NodePort for the Kibana service: 

kubectl -n elk get service kibana -o=jsonpath='{.spec.ports[?(@.port==5601)].nodePort}' 

7. Use the returned port to access Kibana via an IBM Cloud Private node. For example using the proxy 

http://<proxy-ip>:<nodeport> 

This will display the Kibana dashboard. See Figure 5-28. 

<img src='content_image/1005556.jpg'>

8. Set the default index to whichever value you choose. The default is logstash-  but this may change depending on how you modify Logstash in this instance. Note that it is not possible to set the default index until data with that index actually exists in Elasticsearch, so before this can be set, ensure log data is sent to Elasticsearch first. 

## Configuring namespace based indices 

The default Logstash configuration forwards all log data to an index in the format logstash-<year-month-day> . Whilst this is suitable for the platform logs, it makes sense for additional ELK stacks, designed to collect logs for specific namespaces, to create indices based on the namespace the logs originate from. This can be achieved by editing the Logstash ConfigMap and modifying the output to use the kubernetes namespace field as the index name instead of the default logstash . To do this for the ELK stack deployed in previous sections, edit the app-logging-elk-logstash-config  ConfigMap in the elk  namespace and change the output.elasticsearch.index  section from 

output { elasticsearch { hosts => "elasticsearch:9200" index => "logstash-%{+YYYY.MM.dd}" document_type => "%{[@metadata][type]}" 

