# How to add custom index using ingest node pipeline?

**URL:** https://discuss.elastic.co/t/how-to-add-custom-index-using-ingest-node-pipeline/291176
**Category:** Elasticsearch
**Tags:** ingest-pipeline
**Created:** [December 8, 2021, 3:25am UTC](https://discuss.elastic.co/t/how-to-add-custom-index-using-ingest-node-pipeline/291176 "2021-12-08T03:25:37Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![sidharth\_vijayakumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sidharth_vijayakumar/32/97257_2.png) [@sidharth\_vijayakumar](https://discuss.elastic.co/u/sidharth_vijayakumar)
#### Post date: [December 8, 2021, 3:25am UTC](https://discuss.elastic.co/t/how-to-add-custom-index-using-ingest-node-pipeline/291176/1 "2021-12-08T03:25:38Z")

</div>

Is it possible to create conditional indexing by using ingest node pipelines? I feel this could be done by the script processor but can someone tell if this is possible?

I am in a scenario where I should decide which is a better way to do custom indexing. I can mention conditions in the metricbeat.yml /filebeat.yml files to get this done. But is this the best way to do custom indexing? There is no logstash in my elastic stack

```
output.elasticsearch:
          indices:
            - index: "metricbeat-dev-%{[agent.version]}-%{+yyyy.MM.dd}"
              when.equals:
                kubernetes.namespace: "dev"

```

This is how I have implemented custom indexing in metric/filebeat right now. I have like 20+ namespace in my kubernetes cluster. Please help in suggesting if this could be done by ingest node pipeline or not

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [January 5, 2022, 3:26am UTC](https://discuss.elastic.co/t/how-to-add-custom-index-using-ingest-node-pipeline/291176/2 "2022-01-05T03:26:28Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
