# How to remove\_field for json data by http\_poller at all once

**URL:** https://discuss.elastic.co/t/how-to-remove-field-for-json-data-by-http-poller-at-all-once/248545
**Category:** Logstash
**Created:** [September 14, 2020, 2:47pm UTC](https://discuss.elastic.co/t/how-to-remove-field-for-json-data-by-http-poller-at-all-once/248545 "2020-09-14T14:47:09Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![unisuke](https://avatars.discourse-cdn.com/v4/letter/u/9d8465/32.png) [@unisuke](https://discuss.elastic.co/u/unisuke)
#### Post date: [September 14, 2020, 2:47pm UTC](https://discuss.elastic.co/t/how-to-remove-field-for-json-data-by-http-poller-at-all-once/248545/1 "2020-09-14T14:47:09Z")

</div>

Hi.  
I want to filter for jason getting by http\_poller plugin.  
For example, it's below.

```auto
"content" => [
  [0] {
    "AList" => [
      [0] {
        "name" => "X",
      },
      [1] {
        "name" => "Y,
      }
    ],
    "BList" => [
      [0] {
        "name" => "X",
      },
      [1] {
        "name" => "Y",
      }
    ],
  },

  [1] {
    "AList" => [
      [0] {
        "name" => "X",
      },
      [1] {
        "name" => "Y,
      }
    ],
    "BList" => [
      [0] {
        "name" => "X",
      },
      [1] {
        "name" => "Y",
      }
    ],
  }
],

"allFetched" => false,
"result" => true,
"number" => 0
}

```

I want to delete below fields.  
[content][0][AList]  
[content][0][BlList]  
[content][1][AList]  
[content][1][BList]

I could success below remove\_field. But, it is inefficient.

```auto
filter {
        mutate {
                remove_field => [
                "[content][0][AList]",
                "[content][1][AList]",
                "[content][0][BList]",
                "[content][1][BList]"
                ]
        }
}

```

Is there any way to delete them all at once?

```auto
filter {
        mutate {
                remove_field => [
                "[content][*][AList]",
                "[content][*][BList]",
                "[content][*][CList]"
                ]
        }
}

```

---

<div class="post-metadata">

### Author: ![unisuke](https://avatars.discourse-cdn.com/v4/letter/u/9d8465/32.png) [@unisuke](https://discuss.elastic.co/u/unisuke)
#### Post date: [September 19, 2020, 2:47pm UTC](https://discuss.elastic.co/t/how-to-remove-field-for-json-data-by-http-poller-at-all-once/248545/2 "2020-09-19T14:47:38Z")

</div>

I did.  
It's very helpful.

> [@Remove Subfield using ruby](https://discuss.elastic.co/t/remove-subfield-using-ruby/225055/4):
>
> Hi badger thank you, but i tweak a little ruby { code =\> ' event.get("attachments").each\_with\_index { |b,index| event.remove("[attachments][#{index}][documentCharacteristic]") } ' }

```auto
filter {
        ruby {
                code => '
                        event.get("content").each_with_index { |b,index|
                                event.remove("[content][#{index}][AList]")
                        }
                '
        }
}

```

---

<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: [October 17, 2020, 2:47pm UTC](https://discuss.elastic.co/t/how-to-remove-field-for-json-data-by-http-poller-at-all-once/248545/3 "2020-10-17T14:47:38Z")

</div>

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