I have a docker-compose file containing opensearch:2.7 and opensearch-dashboards:2.7
services:
  opensearch:
    image: opensearchproject/opensearch
  opensearch-dashboards:
    image: opensearchproject/opensearch-dashboards
    ports:
    - published: 8094
      target: 5601
I would like for the opensearch dashboard to configure an index pattern on startup.
I noticed that the UI will allow me to export my index pattern.
And then import that index pattern later.
Using the UI, I can successfully re-create the index-patter.
Is there a way to perform this import via docker-compose?
- Can the exported index pattern be mounted into the docker container?
 - Is there an opensearch dashboards API call to trigger the import?
 
Additional information:
- I tried a solution documented in the OpenSearch forum.
 
curl -X POST \
     -H "osd-xsrf: true" \
     "http://admin:admin@localhost:8094/api/saved_objects/_import?overwrite=true" \
     --form file=@data/export.ndjson
The action appears to work. Unfortunately, this does not create a saved object or an index pattern.
{"successCount":1,"success":true,"successResults":[{"type":"index-pattern","id":"62df61e0-ea0b-11ed-b0ee-5f4ec07e6377","meta":{"title":"ecs*","icon":"indexPatternApp"},"overwrite":true}]}

