# Data usage on socket for http request

**URL:** <https://discuss.elastic.co/t/data-usage-on-socket-for-http-request/27577>\
**Category:** Beats\
**Tags:** packetbeat\
**Created:** [August 18, 2015, 10:03am UTC](https://discuss.elastic.co/t/data-usage-on-socket-for-http-request/27577 "2015-08-18T10:03:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nsiitk](https://avatars.discourse-cdn.com/v4/letter/n/8e8cbc/32.png) [@nsiitk](https://discuss.elastic.co/u/nsiitk)\
**Post date:** [August 18, 2015, 10:03am UTC](https://discuss.elastic.co/t/data-usage-on-socket-for-http-request/27577/1 "2015-08-18T10:03:17Z")

</div>

how to calculate data usage for a http request or for socket created by http connect request.

---

<div class="post-metadata">

**Author:** ![tudor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tudor/32/3753_2.png) [@tudor](https://discuss.elastic.co/u/tudor)\
**Post date:** [August 18, 2015, 11:22am UTC](https://discuss.elastic.co/t/data-usage-on-socket-for-http-request/27577/2 "2015-08-18T11:22:41Z")

</div>

For each HTTP request/response pair we store the `bytes_in` and `bytes_out` fields (the size of the request and the size of the response). Beaware that these don't include, however, the IP and TCP headers.

You can identify a single connection by the `(client_ip, client_port, ip, port)` combination.

HTH.

---

<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:** [July 5, 2017, 9:58pm UTC](https://discuss.elastic.co/t/data-usage-on-socket-for-http-request/27577/3 "2017-07-05T21:58:57Z")

</div>


