[stable/kibana] Configure default index pattern
Is this a request for help?: No
Is this a BUG REPORT or FEATURE REQUEST? (choose one): FEATURE REQUEST
Configure default index pattern
Allow a user of the chart to specify a default index pattern in values.yaml.
I've seen that dashboards are loaded into Kibana using an initContainer. In the same way, we could create a default index pattern: https://www.elastic.co/guide/en/kibana/current/saved-objects-api-create.html
I would like to contribute on this if you think this would be a good feature to add, but do have a few questions:
- Do we extend the
initContainersuch that it can handle more than just dashboards? E.g., also a default index pattern and potentially more objects in the future - Would a
PostHookbe a good candidate to implement this?
Which chart:
stable/kibana
I also want this request. @jnsvd do you have a workaround?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any further update will cause the issue/pull request to no longer be considered stale. Thank you for your contributions.
This issue is being automatically closed due to inactivity.
I ran into a situation today where this feature would be greatly beneficial. Can it be reactivated please?
Can we reopen? It is a good feature request in Kubernetes
+1
+1
+1
I also want this request. @jnsvd do you have a workaround?
The following can be added to Kibana's values.yaml, to create a default Index Pattern on deployment
lifecycle:
postStart:
exec:
command:
- bash
- -c
- |
#!/bin/bash
# Config the index_pattern
TEMPLATE_NAME=deault_logstash
INDEX_PATTERN="logstash-*"
KIBANA_URL=http://localhost:5601
# Wait until service is ready
while [[ "$(curl -s -o /dev/null -w '%{http_code}\n' $KIBANA_URL/app/kibana)" != "200" ]]; do sleep 1; done
# Apply default Index Pattern into Kibana
curl -X POST -v $KIBANA_URL/api/saved_objects/index-pattern/$TEMPLATE_NAME \
-H 'kbn-xsrf: true' -H 'Content-Type: application/json' \
-d '{"attributes": {"title": "'$INDEX_PATTERN'"}}'