# How to assign new index pattern to new space

**URL:** <https://discuss.elastic.co/t/how-to-assign-new-index-pattern-to-new-space/371815>\
**Category:** Kibana\
**Tags:** elastic-stack-security\
**Created:** [December 11, 2024, 9:08am UTC](https://discuss.elastic.co/t/how-to-assign-new-index-pattern-to-new-space/371815 "2024-12-11T09:08:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rakesh\_Bare](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rakesh_bare/32/111513_2.png) [@Rakesh\_Bare](https://discuss.elastic.co/u/Rakesh_Bare)\
**Post date:** [December 11, 2024, 9:08am UTC](https://discuss.elastic.co/t/how-to-assign-new-index-pattern-to-new-space/371815/1 "2024-12-11T09:08:41Z")

</div>

How can I use Python code to create a new index pattern and space while importing an existing space dashboard and not assigning the pattern to it?
