# \[filebeat-7.0.x\] Group multiple when/regexp condition for renaming

**URL:** <https://discuss.elastic.co/t/filebeat-7-0-x-group-multiple-when-regexp-condition-for-renaming/180153>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [May 8, 2019, 10:36am UTC](https://discuss.elastic.co/t/filebeat-7-0-x-group-multiple-when-regexp-condition-for-renaming/180153 "2019-05-08T10:36:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jesusgn90](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jesusgn90/32/26998_2.png) [@jesusgn90](https://discuss.elastic.co/u/jesusgn90)\
**Post date:** [May 8, 2019, 10:36am UTC](https://discuss.elastic.co/t/filebeat-7-0-x-group-multiple-when-regexp-condition-for-renaming/180153/1 "2019-05-08T10:36:45Z")

</div>

Hi guys 🙂

Given the next rename blocks for Filebeat:

```auto
  - rename:
      fields:
        - from: "data.aws.sourceIPAddress"
          to: "@src_ip"
      ignore_missing: true
      fail_on_error: false
      when:
        regexp:
          data.aws.sourceIPAddress: \b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b
  - rename:
      fields:
        - from: "data.srcip"
          to: "@src_ip"
      ignore_missing: true
      fail_on_error: false
      when:
        regexp:
          data.srcip: \b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b
  - rename:
      fields:
        - from: "data.win.eventdata.ipAddress"
          to: "@src_ip"
      ignore_missing: true
      fail_on_error: false
      when:
        regexp:
          data.win.eventdata.ipAddress: \b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b

```

Is there a clean way to group the above renames instead of having three blocks?

Regards

---

<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 5, 2019, 10:36am UTC](https://discuss.elastic.co/t/filebeat-7-0-x-group-multiple-when-regexp-condition-for-renaming/180153/2 "2019-06-05T10:36:51Z")

</div>

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