# Best way of setting up \`service.name\` && any other fields that I should set up?

**URL:** <https://discuss.elastic.co/t/best-way-of-setting-up-service-name-any-other-fields-that-i-should-set-up/262700>\
**Category:** Logs\
**Created:** [January 30, 2021, 4:27am UTC](https://discuss.elastic.co/t/best-way-of-setting-up-service-name-any-other-fields-that-i-should-set-up/262700 "2021-01-30T04:27:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fzyzcjy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fzyzcjy/32/78628_2.png) [@fzyzcjy](https://discuss.elastic.co/u/fzyzcjy)\
**Post date:** [January 30, 2021, 4:27am UTC](https://discuss.elastic.co/t/best-way-of-setting-up-service-name-any-other-fields-that-i-should-set-up/262700/1 "2021-01-30T04:27:01Z")

</div>

Hi thanks for this product! I wonder how should I set up the `service.name`? What is the most recommended way to setup it for any `kubernetes pod` (e.g. a Spring java app, a Nginx, a Kafka...)

(Because I see [here](https://discuss.elastic.co/t/log-source-unknown-in-observability-overview/262568/2) saying that, I should set up `service.name` in order to derive the `event.dataset` so as to see the logs categorized.)

Moreover, I wonder whether there are other fields that I should set up in order to make my life better besides this `service.name`?

Thanks very much!

---

<div class="post-metadata">

**Author:** ![weltenwort](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weltenwort/32/53885_2.png) [@weltenwort](https://discuss.elastic.co/u/weltenwort)\
**Post date:** [February 10, 2021, 11:41am UTC](https://discuss.elastic.co/t/best-way-of-setting-up-service-name-any-other-fields-that-i-should-set-up/262700/2 "2021-02-10T11:41:22Z")

</div>

Hi @fzyzcjy,

you should be able to perform quite a bit of correlation with `service.name` and `event.dataset` already. For k8s it might be useful to establish a convention in your environment to add the service name as a label to pods (e.g. `app` or `service_name`) and use the `add_kubernetes_metadata` and `copy_field` processors in the beats config to retrieve and copy it from `kubernetes.label.app` (or so) to `service.name` (and `event.dataset` in the logs case).

(btw, I wanted to clarify that `event.dataset` is not derived automatically, but the recommendation is to use the service name plus a type identifier (e.g. `my_service.log`).)

Does that make sense?

---

<div class="post-metadata">

**Author:** ![fzyzcjy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fzyzcjy/32/78628_2.png) [@fzyzcjy](https://discuss.elastic.co/u/fzyzcjy)\
**Post date:** [February 10, 2021, 12:12pm UTC](https://discuss.elastic.co/t/best-way-of-setting-up-service-name-any-other-fields-that-i-should-set-up/262700/3 "2021-02-10T12:12:29Z")

</div>

Sounds great, Thanks!

---

<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:** [March 10, 2021, 12:12pm UTC](https://discuss.elastic.co/t/best-way-of-setting-up-service-name-any-other-fields-that-i-should-set-up/262700/4 "2021-03-10T12:12:30Z")

</div>

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