# Is it possible to pass "nil" in a @metadata field to "pipeline =\>" on elasticsearch output

**URL:** https://discuss.elastic.co/t/is-it-possible-to-pass-nil-in-a-metadata-field-to-pipeline-on-elasticsearch-output/225424
**Category:** Logstash
**Created:** [March 27, 2020, 2:38pm UTC](https://discuss.elastic.co/t/is-it-possible-to-pass-nil-in-a-metadata-field-to-pipeline-on-elasticsearch-output/225424 "2020-03-27T14:38:03Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![A\_B](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/a_b/32/17104_2.png) [@A\_B](https://discuss.elastic.co/u/A_B)
#### Post date: [March 27, 2020, 2:38pm UTC](https://discuss.elastic.co/t/is-it-possible-to-pass-nil-in-a-metadata-field-to-pipeline-on-elasticsearch-output/225424/1 "2020-03-27T14:38:04Z")

</div>

Hello,

this might be a slightly odd question. I have been successfully gotten by with no conditionals in the output section of my Logstash config for quite some time now. I would however like to start to make use of Elasticsearch ingest pipelines which would mean I have to pass `pipeline` to Elasticsearch on the `elasticsearch` output.

My goal config would be

```
output {
  elasticsearch {
        hosts => ["10.0.0.1:9200"]
        index => "%{[@metadata][log_prefix]}-%{[@metadata][index]}-%{[@metadata][date]}"
        pipeline => "%{[@metadata][pipeline]}"
  }
}

```

According to [this](https://www.elastic.co/guide/en/logstash/7.6/plugins-outputs-elasticsearch.html#plugins-outputs-elasticsearch-pipeline) documentation this field is not _required_ and the default value is `nil`.

When I try to set `pipeline` to `nil` or set `[@metadata][pipeline]` to `nil`, Logstash can not index any document. I might do something wrong...

I have created a "dummy" ingest pipeline in Elasticsearch and that seems to work. The pipeline adds one field, which I would like to avoid. I assume Elasticsearch ingest nodes have more work to do as well (of course adding that field).

Is this just the way it is? Now that I see my config here I see that `%{[@metadata][pipeline]}` is quoted so passing `nil` will not work...

Any suggestions or ideas? 🙂

---

<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: [April 24, 2020, 2:38pm UTC](https://discuss.elastic.co/t/is-it-possible-to-pass-nil-in-a-metadata-field-to-pipeline-on-elasticsearch-output/225424/2 "2020-04-24T14:38:07Z")

</div>

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