# Logstash - Saving Soap/Rest Request

**URL:** <https://discuss.elastic.co/t/logstash-saving-soap-rest-request/36912>\
**Category:** Logstash\
**Created:** [December 10, 2015, 7:57pm UTC](https://discuss.elastic.co/t/logstash-saving-soap-rest-request/36912 "2015-12-10T19:57:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rakesh76](https://avatars.discourse-cdn.com/v4/letter/r/839c29/32.png) [@rakesh76](https://discuss.elastic.co/u/rakesh76)\
**Post date:** [December 10, 2015, 7:57pm UTC](https://discuss.elastic.co/t/logstash-saving-soap-rest-request/36912/1 "2015-12-10T19:57:40Z")

</div>

Hi

```
I am very new to elastic search and logstash so need guidance.

```

1. We are having different environment e.g dev1, dev2, test, For each environment there is log4 log file which contains soap/rest request.

2. I am able to parse those file using GROK pattern and able to save in ES.

3. Our Soap/REST and request/response is having one of the filed called transaction id

my search query should be "environment=? and transactionId=?"

How can I achieve this ?

Thanks

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [December 11, 2015, 8:09am UTC](https://discuss.elastic.co/t/logstash-saving-soap-rest-request/36912/2 "2015-12-11T08:09:19Z")

</div>

Use the [xml filter](https://www.elastic.co/guide/en/logstash/current/plugins-filters-xml.html) to parse the message and extract the transaction id into a field of its own. To get the environment name into each event, use `add_field` in the input declaration:

```auto
input {
  file {
    ...
    path => "/some/path/dev1.log"
    add_field => {
      "environment" => "dev1"
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![rakesh76](https://avatars.discourse-cdn.com/v4/letter/r/839c29/32.png) [@rakesh76](https://discuss.elastic.co/u/rakesh76)\
**Post date:** [December 11, 2015, 3:21pm UTC](https://discuss.elastic.co/t/logstash-saving-soap-rest-request/36912/3 "2015-12-11T15:21:37Z")

</div>

Thanks magnusbaeck for your reply.

---

<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 6, 2017, 5:18am UTC](https://discuss.elastic.co/t/logstash-saving-soap-rest-request/36912/4 "2017-07-06T05:18:50Z")

</div>


