# Filebeat how to get content of field

**URL:** <https://discuss.elastic.co/t/filebeat-how-to-get-content-of-field/232621>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [May 14, 2020, 10:46am UTC](https://discuss.elastic.co/t/filebeat-how-to-get-content-of-field/232621 "2020-05-14T10:46:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lukolas](https://avatars.discourse-cdn.com/v4/letter/l/ba9def/32.png) [@Lukolas](https://discuss.elastic.co/u/Lukolas)\
**Post date:** [May 14, 2020, 10:46am UTC](https://discuss.elastic.co/t/filebeat-how-to-get-content-of-field/232621/1 "2020-05-14T10:46:07Z")

</div>

Hello

I have got a flow from openshift where filebeat get logs from applications and send it to logstash.  
In logstash i can read value of app name and send logs to dedicated kafka topic.  
I'm using `"%{[kubernetes][labels][app]}"` to get content of field - it works fine.

Question: am I able to do the same in filebeat? Read content of field?  
I have tried do the same on filebeat but i got error:  
missing field accessing - it's look like there is no that field yet.  
In filebeat conf file I have `'${[kubernetes.labels.app]}'`

---

<div class="post-metadata">

**Author:** ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)\
**Post date:** [May 14, 2020, 6:54pm UTC](https://discuss.elastic.co/t/filebeat-how-to-get-content-of-field/232621/2 "2020-05-14T18:54:31Z")

</div>

Hey @Lukolas, welcome to discuss 🙂

On what part of filebeat configuration you are trying to use this field? If the setting accepts using fields, i think you should put it as `%{[kubernetes.labels.app]}`.

---

<div class="post-metadata">

**Author:** ![Lukolas](https://avatars.discourse-cdn.com/v4/letter/l/ba9def/32.png) [@Lukolas](https://discuss.elastic.co/u/Lukolas)\
**Post date:** [May 15, 2020, 11:37am UTC](https://discuss.elastic.co/t/filebeat-how-to-get-content-of-field/232621/3 "2020-05-15T11:37:14Z")

</div>

Hey @jsoriano  
You' re right `%{[kubernetes.labels.app]}` works for output.kafka - \> topic filed, because is dynamically.  
I wrongly assumed all value in connfiguration file can be dynamically and i have tried to add custom filed before output with name of topic with reference to filed kubernetes.labels.app.  
My new custom fileds value was string from field name.

Thank You @jsoriano

---

<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:** [June 12, 2020, 11:42am UTC](https://discuss.elastic.co/t/filebeat-how-to-get-content-of-field/232621/4 "2020-06-12T11:42:12Z")

</div>

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