# Inserting a dummy value for empty field while parsing using grok logstash

**URL:** https://discuss.elastic.co/t/inserting-a-dummy-value-for-empty-field-while-parsing-using-grok-logstash/232408
**Category:** Logstash
**Created:** [May 13, 2020, 9:59am UTC](https://discuss.elastic.co/t/inserting-a-dummy-value-for-empty-field-while-parsing-using-grok-logstash/232408 "2020-05-13T09:59:44Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Devyani](https://avatars.discourse-cdn.com/v4/letter/d/858c86/32.png) [@Devyani](https://discuss.elastic.co/u/Devyani)
#### Post date: [May 13, 2020, 9:59am UTC](https://discuss.elastic.co/t/inserting-a-dummy-value-for-empty-field-while-parsing-using-grok-logstash/232408/1 "2020-05-13T09:59:44Z")

</div>

I want to have the dummy value for empty field while parsing grok pattern.  
I have used the following condition--\>  
if ![exception\_stacktrace] {  
mutate {  
replace =\> ["exception\_stacktrace", "-"]  
}  
}  
But with this my grok pattern is not working if exception\_stacktrace is present.

---

<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 10, 2020, 9:59am UTC](https://discuss.elastic.co/t/inserting-a-dummy-value-for-empty-field-while-parsing-using-grok-logstash/232408/2 "2020-06-10T09:59:58Z")

</div>

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