# What's the best way to track calls to a specific URL?

**URL:** <https://discuss.elastic.co/t/whats-the-best-way-to-track-calls-to-a-specific-url/94825>\
**Category:** Beats\
**Tags:** packetbeat\
**Created:** [July 27, 2017, 3:39pm UTC](https://discuss.elastic.co/t/whats-the-best-way-to-track-calls-to-a-specific-url/94825 "2017-07-27T15:39:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bobby](https://avatars.discourse-cdn.com/v4/letter/b/df788c/32.png) [@Bobby](https://discuss.elastic.co/u/Bobby)\
**Post date:** [July 27, 2017, 3:39pm UTC](https://discuss.elastic.co/t/whats-the-best-way-to-track-calls-to-a-specific-url/94825/1 "2017-07-27T15:39:01Z")

</div>

I have Packetbeat installed on an application server. I'd like a way to determine how many calls to a given URL (say, [www.xyz.com](http://www.xyz.com)) are made per time frame I'm searching on in Kibana. What would be the best way to accomplish this, via Packetbeat? There are the flows, and there are also the HTTP and DNS protocols that I imagine would be useful.

What's difficult with the flows and the HTTP protocol is the log information appears to be happening after the domain name has been translated to an IP address. I don't know the IP addresses of this URL ahead of time, and I don't think I can rely on it staying the same.

DNS protocol logs seem like they might be useful here. I believe the [dns.question.name](http://dns.question.name) maps to the URL that is being called. But it doesn't look like those logs map 1 to 1 with calls to those URLs. (Once the domain name has been resolved to an IP address, I imagined it's cached somewhere?)

Thanks!

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [July 27, 2017, 3:42pm UTC](https://discuss.elastic.co/t/whats-the-best-way-to-track-calls-to-a-specific-url/94825/2 "2017-07-27T15:42:15Z")

</div>

> [@Bobby](#):
>
> What's difficult with the flows and the HTTP protocol is the log information appears to be happening after the domain name has been translated to an IP address.

If you configure packetbeat to record the `Host` header you will know the domain name.

> [@Bobby](#):
>
> DNS protocol logs seem like they might be useful here.

If you are looking to track incoming requests to the application server then the DNS traffic won't be helpful because the DNS requests will occur on the client side before making the HTTP request to your server.

---

<div class="post-metadata">

**Author:** ![Bobby](https://avatars.discourse-cdn.com/v4/letter/b/df788c/32.png) [@Bobby](https://discuss.elastic.co/u/Bobby)\
**Post date:** [July 27, 2017, 5:07pm UTC](https://discuss.elastic.co/t/whats-the-best-way-to-track-calls-to-a-specific-url/94825/3 "2017-07-27T17:07:33Z")

</div>

Hey Andrew,

What field am I looking for with the once I add send\_headers: ["Host"]?

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [July 27, 2017, 5:10pm UTC](https://discuss.elastic.co/t/whats-the-best-way-to-track-calls-to-a-specific-url/94825/4 "2017-07-27T17:10:09Z")

</div>

The request headers are written to [http.request.headers](https://www.elastic.co/guide/en/beats/packetbeat/current/exported-fields-http.html#_http_request_headers). So `http.request.headers.Host`.

---

<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:** [August 24, 2017, 5:10pm UTC](https://discuss.elastic.co/t/whats-the-best-way-to-track-calls-to-a-specific-url/94825/5 "2017-08-24T17:10:10Z")

</div>

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