# Conditionals with nested fields in logstash not working

**URL:** <https://discuss.elastic.co/t/conditionals-with-nested-fields-in-logstash-not-working/254424>\
**Category:** Logstash\
**Created:** [November 5, 2020, 2:29pm UTC](https://discuss.elastic.co/t/conditionals-with-nested-fields-in-logstash-not-working/254424 "2020-11-05T14:29:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![darlin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/darlin/32/78481_2.png) [@darlin](https://discuss.elastic.co/u/darlin)\
**Post date:** [November 5, 2020, 2:29pm UTC](https://discuss.elastic.co/t/conditionals-with-nested-fields-in-logstash-not-working/254424/1 "2020-11-05T14:29:24Z")

</div>

Hi,

somehow when we use the input http plugin afterwards the conditionals with nested fields are not working. I've already tried with a non nested field and then it is working.

With the below configuration the request will be sent to elasticsearch instead of the businessobjects pipeline

**HTTP Input Pipeline**

```auto
    input {
  http {
    port => 8080
  }
}

output {
  if [log][message] =~ ".*BO.*" {
    pipeline {
      send_to => "businessobjects"
    }
  }
  else {
    elasticsearch {
   ....
   }
  }
  stdout { codec => rubydebug }
}

```

**JSON Body of Request**

```auto
    {
   "log.message":"BO Data is published",
}

```

I hope anyone can help!  
Thank you  
Darlin

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [November 5, 2020, 3:13pm UTC](https://discuss.elastic.co/t/conditionals-with-nested-fields-in-logstash-not-working/254424/2 "2020-11-05T15:13:38Z")

</div>

> [@darlin](#):
>
> `"log.message":"BO Data is published"`

That would be [log.message]

[log][message] would be used if the JSON were

```
{ "log": { "message": "BO Data is published" } }

```

---

<div class="post-metadata">

**Author:** ![darlin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/darlin/32/78481_2.png) [@darlin](https://discuss.elastic.co/u/darlin)\
**Post date:** [November 6, 2020, 11:50am UTC](https://discuss.elastic.co/t/conditionals-with-nested-fields-in-logstash-not-working/254424/3 "2020-11-06T11:50:33Z")

</div>

Thank you! Now it's working!

---

<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:** [December 4, 2020, 11:50am UTC](https://discuss.elastic.co/t/conditionals-with-nested-fields-in-logstash-not-working/254424/4 "2020-12-04T11:50:36Z")

</div>

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