# Access the request via Logstash - Map keys

**URL:** <https://discuss.elastic.co/t/access-the-request-via-logstash-map-keys/183441>\
**Category:** Logstash\
**Created:** [May 30, 2019, 1:02am UTC](https://discuss.elastic.co/t/access-the-request-via-logstash-map-keys/183441 "2019-05-30T01:02:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adam\_Grimes](https://avatars.discourse-cdn.com/v4/letter/a/9de053/32.png) [@Adam\_Grimes](https://discuss.elastic.co/u/Adam_Grimes)\
**Post date:** [May 30, 2019, 1:02am UTC](https://discuss.elastic.co/t/access-the-request-via-logstash-map-keys/183441/1 "2019-05-30T01:02:22Z")

</div>

I have the following structure:

```auto
  "_index": "test",
  "_type": "_doc",
  "_id": "01",
  "_version": 1,
  "_score": 0,
  "_source": {
    "@timestamp": "2019-05-30T00:36:19.622Z",
    "type": "db_use",
    "tags": [
      "db_use"
    ],
    "doc_as_upsert": true,
    "@version": "1",
    "doc": {
      "rev": "1-cf46be7245acaed7d08150fb701e952a",
      "request": [
        {
          "divide": {
            "test": {},
            "header": {
             "header": [
             "Connection: close"
             "tipoMime": "JSON",
             "body": " "
            }
          },

```

I'm trying to get filters to access the request field to create searchable fields in header and body, but I can not create a filter to access the request. How could I proceed with this?

tests as unsuccessful=\>

```auto
if "requests" in [tags] {
		mutate { add_field => { "@tes3" => "%{[doc]}" } }
	}
	if "doc" in [tags] {
		mutate { add_field => { "@tes4" => "%{[@metadata][_rev]}" } }
	}
	if [type] == "requests" {
		mutate { add_field => { "@tes5" => "%{requests}" } }

```

---

<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:** [June 27, 2019, 1:02am UTC](https://discuss.elastic.co/t/access-the-request-via-logstash-map-keys/183441/2 "2019-06-27T01:02:33Z")

</div>

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