# How to combine two numerical fields

**URL:** <https://discuss.elastic.co/t/how-to-combine-two-numerical-fields/207817>\
**Category:** Logstash\
**Created:** [November 14, 2019, 6:06am UTC](https://discuss.elastic.co/t/how-to-combine-two-numerical-fields/207817 "2019-11-14T06:06:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mastinder](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mastinder/32/128357_2.png) [@mastinder](https://discuss.elastic.co/u/mastinder)\
**Post date:** [November 14, 2019, 6:06am UTC](https://discuss.elastic.co/t/how-to-combine-two-numerical-fields/207817/1 "2019-11-14T06:06:41Z")

</div>

I want to combine these two fields | (?\<byte\_read\>(-|%{INT})) | (?\<byte\_written\>(-|%{INT})) |

and want one field like tota\_bytes=byte\_read+byte\_written , can someone guide me how to do it.

%{IP:client-ip}_+ | %{WORD:protocol} | (?(i|o))+%{DATA:Stash\_Unique\_Identifier}x%{DATA:Request\_Minutes\_In\_Day}x%{INT:request\_number\_since\_last\_restart}x%{INT:Number\_Of\_Requests\_Being \_Serviced\_Concurrently\_At\_The\_Start\_Of\_The\_Request} | %{USER:user}_+ | %{TIMESTAMP\_ISO8601:date} | "(?:%{DATA:http-method}) /%{USERNAME:scm}/(?%{USERNAME:project}/%{USERNAME:repo})/git-upload-pack(?: HTTP/%{NUMBER:http-version})" | %{QS:referer}_?(\s)%{QS:agent}_? | (?(-|%{INT})) | (?\<byte\_read\>(-|%{INT})) | (?\<byte\_written\>(-|%{INT})) | %{GREEDYDATA:DB\_TABLES} | (?(-|%{INT})) | (?(-|%{WORD})) |

---

<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:** [December 12, 2019, 6:06am UTC](https://discuss.elastic.co/t/how-to-combine-two-numerical-fields/207817/2 "2019-12-12T06:06:44Z")

</div>

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