# Mutate filter doesn't work with error.message (heartbeat) field

**URL:** https://discuss.elastic.co/t/mutate-filter-doesnt-work-with-error-message-heartbeat-field/116261
**Category:** Logstash
**Created:** [January 19, 2018, 3:07pm UTC](https://discuss.elastic.co/t/mutate-filter-doesnt-work-with-error-message-heartbeat-field/116261 "2018-01-19T15:07:20Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Bozzerreaneaux](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bozzerreaneaux/32/21613_2.png) [@Bozzerreaneaux](https://discuss.elastic.co/u/Bozzerreaneaux)
#### Post date: [January 19, 2018, 3:07pm UTC](https://discuss.elastic.co/t/mutate-filter-doesnt-work-with-error-message-heartbeat-field/116261/1 "2018-01-19T15:07:20Z")

</div>

Hello,

trying to do a quick filter to replace a given heartbeat field value based on the value of other field but it seems when the field has a dot in the name `t error.message`, the filter doesn't work:

works:

```
if [ip] == "10.10.11.25" {
	mutate {
		replace => ["up", "true"]
	}
}

```

doesn't work:

```
if [error.message] == "401 Unauthorized" {
	mutate {
		replace => ["up", "true"]
	}
}

```

Is there anything special about those types of fields or I am missing something here?

Thanks in advance,

--Boz

---

<div class="post-metadata">

### Author: ![Bozzerreaneaux](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bozzerreaneaux/32/21613_2.png) [@Bozzerreaneaux](https://discuss.elastic.co/u/Bozzerreaneaux)
#### Post date: [January 19, 2018, 3:20pm UTC](https://discuss.elastic.co/t/mutate-filter-doesnt-work-with-error-message-heartbeat-field/116261/2 "2018-01-19T15:20:53Z")

</div>

Sorry, got it to work. I just learned subfields existed. specifying [error][message] fixed it.

if [error][message] == "401 Unauthorized" {  
mutate {  
replace =\> ["up", "true"]  
}  
}

[https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html#logstash-config-field-references](https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html#logstash-config-field-references)

---

<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 16, 2018, 3:21pm UTC](https://discuss.elastic.co/t/mutate-filter-doesnt-work-with-error-message-heartbeat-field/116261/3 "2018-02-16T15:21:12Z")

</div>

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