# Read Optional fields

**URL:** <https://discuss.elastic.co/t/read-optional-fields/122779>\
**Category:** Logstash\
**Created:** [March 6, 2018, 8:17pm UTC](https://discuss.elastic.co/t/read-optional-fields/122779 "2018-03-06T20:17:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![millerb1](https://avatars.discourse-cdn.com/v4/letter/m/e47c2d/32.png) [@millerb1](https://discuss.elastic.co/u/millerb1)\
**Post date:** [March 6, 2018, 8:17pm UTC](https://discuss.elastic.co/t/read-optional-fields/122779/1 "2018-03-06T20:17:56Z")

</div>

We have installed File-Beats on multiple servers to harvest JBoss logs and save through the same Log-Stash pipeline into Elastic-Search. We have set the optional fields in File-Beats config and want to save the Channel and Node into their own Elastic-Search field.

**File-Beats config line 95 - 98:**

# Optional fields that you can specify to add additional information to the

# output.

#fields:  
channel: QA  
node: 1

**Log-Stash config**  
filter {  
grok {  
match =\> [  
"message",  
"%{CHANNEL:channel} %{NODE:node} %{TIME:time} %{LOGLEVEL:level} [(?[^]]+)] ((?[^)]+)) %{GREEDYDATA:message}"  
]  
overwrite =\> ["message"]  
}  
}

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [March 7, 2018, 10:46am UTC](https://discuss.elastic.co/t/read-optional-fields/122779/2 "2018-03-07T10:46:09Z")

</div>

- Don't comment the `fields:` line.
- It doesn't seem to make sense to both save the fields via the Filebeat configuration _and_ extract the same fields in the grok filter. Pick one method of obtaining those field values.

---

<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:** [April 4, 2018, 10:46am UTC](https://discuss.elastic.co/t/read-optional-fields/122779/3 "2018-04-04T10:46:19Z")

</div>

Closed on April 4, 2018, 10:46am UTC

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