# Can logstash parsing port number with service name?

**URL:** <https://discuss.elastic.co/t/can-logstash-parsing-port-number-with-service-name/302080>\
**Category:** Logstash\
**Created:** [April 11, 2022, 9:03am UTC](https://discuss.elastic.co/t/can-logstash-parsing-port-number-with-service-name/302080 "2022-04-11T09:03:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![111401](https://avatars.discourse-cdn.com/v4/letter/1/e19b73/32.png) [@111401](https://discuss.elastic.co/u/111401)\
**Post date:** [April 11, 2022, 9:03am UTC](https://discuss.elastic.co/t/can-logstash-parsing-port-number-with-service-name/302080/1 "2022-04-11T09:03:22Z")

</div>

Hi,

I wonder that is there any plugin or tools to help logstash use the `port` field to parsing corresponding service name? Like 53/tcp it will parsing the service name "DNS".  
Or I need to create a list of port/service, and use other tools to read this list and parsing? If so, could someone tell me how to do in detail.

Appreciate to any reply.

---

<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:** [April 11, 2022, 12:23pm UTC](https://discuss.elastic.co/t/can-logstash-parsing-port-number-with-service-name/302080/2 "2022-04-11T12:23:16Z")

</div>

It seems that the [translate filter](https://www.elastic.co/guide/en/logstash/current/plugins-filters-translate.html) can help you.

This filter will create a new field based on the value of other field.

For example, if you have a field named `service` with the valu `53/tcp`, you could create a translate that will create another field with the value `DNS`.

I wrote a small [blog post](https://web.leandrojmp.com/posts/en/2021/02/logstash-translate) a little time ago with an example on how to implement the translate filter, you can check it if you want an example.

---

<div class="post-metadata">

**Author:** ![111401](https://avatars.discourse-cdn.com/v4/letter/1/e19b73/32.png) [@111401](https://discuss.elastic.co/u/111401)\
**Post date:** [April 12, 2022, 8:39am UTC](https://discuss.elastic.co/t/can-logstash-parsing-port-number-with-service-name/302080/3 "2022-04-12T08:39:40Z")

</div>

This is exactly what I need. Thank you.

---

<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:** [May 10, 2022, 8:40am UTC](https://discuss.elastic.co/t/can-logstash-parsing-port-number-with-service-name/302080/4 "2022-05-10T08:40:37Z")

</div>

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