# Logstash: access name of current pipeline within cfg?

**URL:** https://discuss.elastic.co/t/logstash-access-name-of-current-pipeline-within-cfg/195786
**Category:** Logstash
**Created:** [August 19, 2019, 5:19pm UTC](https://discuss.elastic.co/t/logstash-access-name-of-current-pipeline-within-cfg/195786 "2019-08-19T17:19:10Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Luca\_Belluccini](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/luca_belluccini/32/33239_2.png) [@Luca\_Belluccini](https://discuss.elastic.co/u/Luca_Belluccini)
#### Post date: [September 6, 2019, 10:55am UTC](https://discuss.elastic.co/t/logstash-access-name-of-current-pipeline-within-cfg/195786/2 "2019-09-06T10:55:07Z")

</div>

Hello,  
At the moment it's not possible to have the name of the pipeline from the `[@metadata]` fields, but you can get them via Ruby using:

```auto
ruby { code => "event.set(\"pipeline_id\", execution_context.pipeline.pipeline_id)" }

```

Please note this will trigger an error if you're not using multiple pipelines.

Hope it helps!

Best regards,  
Luca

---

_[View the full topic](https://discuss.elastic.co/t/logstash-access-name-of-current-pipeline-within-cfg/195786)._
