# Mutate | Some logs are parsed some not

**URL:** <https://discuss.elastic.co/t/mutate-some-logs-are-parsed-some-not/166007>\
**Category:** Logstash\
**Created:** [January 28, 2019, 2:26pm UTC](https://discuss.elastic.co/t/mutate-some-logs-are-parsed-some-not/166007 "2019-01-28T14:26:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![thirty2](https://avatars.discourse-cdn.com/v4/letter/t/a9a28c/32.png) [@thirty2](https://discuss.elastic.co/u/thirty2)\
**Post date:** [January 28, 2019, 2:26pm UTC](https://discuss.elastic.co/t/mutate-some-logs-are-parsed-some-not/166007/1 "2019-01-28T14:26:02Z")

</div>

Hi,

did you ever observed that some logs are parsed and some not when using MUTATE filter?

Thanks

---

<div class="post-metadata">

**Author:** ![guyboertje](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guyboertje/32/31592_2.png) [@guyboertje](https://discuss.elastic.co/u/guyboertje)\
**Post date:** [January 29, 2019, 12:29pm UTC](https://discuss.elastic.co/t/mutate-some-logs-are-parsed-some-not/166007/2 "2019-01-29T12:29:43Z")

</div>

We need more information to be able to help. The mutate filter has many sub functions.

---

<div class="post-metadata">

**Author:** ![thirty2](https://avatars.discourse-cdn.com/v4/letter/t/a9a28c/32.png) [@thirty2](https://discuss.elastic.co/u/thirty2)\
**Post date:** [January 30, 2019, 8:35am UTC](https://discuss.elastic.co/t/mutate-some-logs-are-parsed-some-not/166007/3 "2019-01-30T08:35:16Z")

</div>

Filter is really simple, and i can see that some logs have the new tag and some not.

```
filter {
     mutate {
     add_tag => ["beparsed"]
  }
 }

output {
elasticsearch {
index => "logstash-%{+xxxx.ww}"
hosts => ["[ip]:9200","[ip]:9200","[ip]:9200"]
manage_template => true
}
}

```

Also tried:

```
  filter {
	json {
       source => "rawdata"
       skip_on_invalid_json => true
         }
         mutate {
         add_tag => ["beparsed"]
      }
     }
```

---

<div class="post-metadata">

**Author:** ![guyboertje](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guyboertje/32/31592_2.png) [@guyboertje](https://discuss.elastic.co/u/guyboertje)\
**Post date:** [January 30, 2019, 12:25pm UTC](https://discuss.elastic.co/t/mutate-some-logs-are-parsed-some-not/166007/4 "2019-01-30T12:25:12Z")

</div>

Using mutate/add\_tag in this way should add a tag to every event (log).

Which version of Logstash and the mutate plugin are you using?

`bin/logstash --version`  
`bin/logstash-plugin list --verbose | grep mutate`

---

<div class="post-metadata">

**Author:** ![thirty2](https://avatars.discourse-cdn.com/v4/letter/t/a9a28c/32.png) [@thirty2](https://discuss.elastic.co/u/thirty2)\
**Post date:** [January 31, 2019, 8:09am UTC](https://discuss.elastic.co/t/mutate-some-logs-are-parsed-some-not/166007/5 "2019-01-31T08:09:10Z")

</div>

It is:  
logstash 5.2.1  
logstash-filter-mutate (3.1.3)

i also tried:

```
filter {
     json {
       source => "rawdata"
       skip_on_invalid_json => true
  }
     mutate {
       remove_field => ["host01", "timestamp", "type"]
 }
}

```

And it is the same, some logs are parsed some not. The reason why i want to do that is because i am getting raw logs with no structure. So i have applied simple filter and i was able to see logs in Kibana with structure, containing fields from the raw log. But not all of them, that is the problem.

---

<div class="post-metadata">

**Author:** ![guyboertje](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guyboertje/32/31592_2.png) [@guyboertje](https://discuss.elastic.co/u/guyboertje)\
**Post date:** [January 31, 2019, 9:38am UTC](https://discuss.elastic.co/t/mutate-some-logs-are-parsed-some-not/166007/6 "2019-01-31T09:38:43Z")

</div>

I don't have an explanation why some events are not being seen in kibana.

As a comparison, you should try 6.6.0 of the Stack.

---

<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:** [February 28, 2019, 9:38am UTC](https://discuss.elastic.co/t/mutate-some-logs-are-parsed-some-not/166007/7 "2019-02-28T09:38:44Z")

</div>

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