# Alter filed in logstash filter for Metricbeat

**URL:** <https://discuss.elastic.co/t/alter-filed-in-logstash-filter-for-metricbeat/117935>\
**Category:** Logstash\
**Created:** [February 1, 2018, 6:09am UTC](https://discuss.elastic.co/t/alter-filed-in-logstash-filter-for-metricbeat/117935 "2018-02-01T06:09:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tharu85](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@tharu85](https://discuss.elastic.co/u/tharu85)\
**Post date:** [February 1, 2018, 6:09am UTC](https://discuss.elastic.co/t/alter-filed-in-logstash-filter-for-metricbeat/117935/1 "2018-02-01T06:09:15Z")

</div>

I have configure Metricbeat and send system metric to logstash. Sample metricbeat output as below

```
{
"@timestamp" => 2018-02-01T05:36:14.330Z,
    "system" => {
    "network" => {
          "in" => {
              "bytes" => 535630,
            "dropped" => 0,
             "errors" => 0,
            "packets" => 1217
        },
        "name" => "lo",
         "out" => {
              "bytes" => 535630,
            "dropped" => 0,
            "packets" => 1217,
             "errors" => 0
        }
    }
},
      "beat" => {
    "hostname" => "elasticsearch-two",
        "name" => "elasticsearch-two",
     "version" => "6.1.3"
},
  "@version" => "1",
      "host" => "elasticsearch-two",
 "metricset" => {
       "rtt" => 361,
    "module" => "system",
      "name" => "network"
},
      "tags" => [
    [0] "beats_input_raw_event"
]
}

```

In logstash I want rename filed name to my own name.  
For an example

```
 "system" => {
    "network" => {
          "in" => {
              "bytes" => 535630,
            "dropped" => 0,
             "errors" => 0,
            "packets" => 1217
        },

```

I want to rename "in" "bytes" fields as input\_bytes, "in" "dropped" as input\_droppped and etc.

So how can I define filter in logstash to meet my requirement

---

<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:** [February 1, 2018, 7:03am UTC](https://discuss.elastic.co/t/alter-filed-in-logstash-filter-for-metricbeat/117935/2 "2018-02-01T07:03:05Z")

</div>

Have you looked into the mutate filter and its rename option? See [https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html](https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html) for the syntax used to reference subfields.

---

<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:** [March 1, 2018, 7:03am UTC](https://discuss.elastic.co/t/alter-filed-in-logstash-filter-for-metricbeat/117935/3 "2018-03-01T07:03:25Z")

</div>

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