# Search in HTTP request field

**URL:** <https://discuss.elastic.co/t/search-in-http-request-field/103594>\
**Category:** Kibana\
**Created:** [October 11, 2017, 6:18pm UTC](https://discuss.elastic.co/t/search-in-http-request-field/103594 "2017-10-11T18:18:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohsen\_Ibrahim](https://avatars.discourse-cdn.com/v4/letter/m/f4b2a3/32.png) [@Mohsen\_Ibrahim](https://discuss.elastic.co/u/Mohsen_Ibrahim)\
**Post date:** [October 11, 2017, 6:18pm UTC](https://discuss.elastic.co/t/search-in-http-request-field/103594/1 "2017-10-11T18:18:13Z")

</div>

Hi,

I am using ELK stack to index my apache access logs and everything is just fine but I have small problem here it is

I need to find all documents which their request field starts with '/page1' so I can graph the response time of page1 only and not all pages I tried the following:

request:page1 this gives me requests which have page1 in their request url not just at the start  
request:/^/page1/ this gives me zero results

Can you help me with this?

I need to find all documents which start with '/page1/` only and not requests which contain /page1 in their url.

Thanks a lot.

---

<div class="post-metadata">

**Author:** ![timroes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timroes/32/19712_2.png) [@timroes](https://discuss.elastic.co/u/timroes)\
**Post date:** [October 12, 2017, 7:33am UTC](https://discuss.elastic.co/t/search-in-http-request-field/103594/2 "2017-10-12T07:33:45Z")

</div>

Hi Mohsen,

the issue in this case is most likely the analyzing of the data. If you are using the Elastic Stack 5.0+ above, and haven't tweaked the mapping, there should also be a `request.keyword` field, which has the non unanalzed string (and thus the path in place, and not splitted up at each slash).

The following query should work: `request.keyword:\/page1*` (The slash in the beginning must be escaped, so Elasticsearch doesn't think you are trying to start a regex. Also this wildcard search should be way faster than using regular expressions.

Also if you would want a regular expression the following should work the same: `request.keyword:/\/page1.*/` - escaping of the slash is also needed here, and ES always tries to match the whole string, so you don't need the `^`, but therefore the `.*` in the end.

I've tried to explaint he effects of analyzing to querying in a [blog post](https://www.timroes.de/2016/05/29/elasticsearch-kibana-queries-in-depth-tutorial/) on my page.

Cheers,  
Tim

---

<div class="post-metadata">

**Author:** ![Mohsen\_Ibrahim](https://avatars.discourse-cdn.com/v4/letter/m/f4b2a3/32.png) [@Mohsen\_Ibrahim](https://discuss.elastic.co/u/Mohsen_Ibrahim)\
**Post date:** [October 13, 2017, 6:07am UTC](https://discuss.elastic.co/t/search-in-http-request-field/103594/3 "2017-10-13T06:07:28Z")

</div>

Hi timroes,

Thanks a lot for your reply it solved my problem 🙂

---

<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:** [November 10, 2017, 6:07am UTC](https://discuss.elastic.co/t/search-in-http-request-field/103594/4 "2017-11-10T06:07:33Z")

</div>

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