# Use variable with logstash

**URL:** <https://discuss.elastic.co/t/use-variable-with-logstash/343462>\
**Category:** Logstash\
**Created:** [September 20, 2023, 1:28pm UTC](https://discuss.elastic.co/t/use-variable-with-logstash/343462 "2023-09-20T13:28:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sam1975](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@sam1975](https://discuss.elastic.co/u/sam1975)\
**Post date:** [September 20, 2023, 1:28pm UTC](https://discuss.elastic.co/t/use-variable-with-logstash/343462/1 "2023-09-20T13:28:46Z")

</div>

Hello  
I have a long list like this  
if [monitoring\_data\_name] == "componentFault" {  
pipeline { send\_to =\> "componentFault" }  
}  
else if [monitoring\_data\_name] == "localAccountPasswordModification" {  
pipeline { send\_to =\> "localAccountPasswordModification" }  
}  
else if [monitoring\_data\_name] == "sshPDUConnection" {  
pipeline { send\_to =\> "sshPDUConnection" }  
}  
else if [monitoring\_data\_name] == "activeCircleFtpsConnection" {  
pipeline { send\_to =\> "activeCircleFtpsConnection" }  
}  
etc....  
Is it possible to make something more synthetic by using variables and how?  
Regards

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [September 20, 2023, 1:48pm UTC](https://discuss.elastic.co/t/use-variable-with-logstash/343462/2 "2023-09-20T13:48:41Z")

</div>

> [@sam1975](#):
>
> Is it possible to make something more synthetic by using variables and how?

Unfortunately no, the `pipeline` output is pretty simple and do not supports using variables or a dynamic value like a field name.

---

<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:** [October 18, 2023, 1:49pm UTC](https://discuss.elastic.co/t/use-variable-with-logstash/343462/3 "2023-10-18T13:49:23Z")

</div>

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