# Null and nil

**URL:** <https://discuss.elastic.co/t/null-and-nil/258507>\
**Category:** Logstash\
**Created:** [December 13, 2020, 1:25pm UTC](https://discuss.elastic.co/t/null-and-nil/258507 "2020-12-13T13:25:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rojin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rojin/32/97697_2.png) [@rojin](https://discuss.elastic.co/u/rojin)\
**Post date:** [December 13, 2020, 1:25pm UTC](https://discuss.elastic.co/t/null-and-nil/258507/1 "2020-12-13T13:25:44Z")

</div>

Hello everyone! I have a grok pattern which some of its fields may include "null" values. How am I supposed to show null in kibana? or logstash output? I have defined the pattern as number for those fields.

```
input {
    file {
	type => "log"
        path => "/home/rojin/Desktop/customer/customer.log"
        start_position => "beginning"
        sincedb_path => "/dev/null"
    }
}

filter {
    if "INFO" in [message] and "successfully" in [message] {
        grok {
            patterns_dir => ["path/to/patterns"]
            match => { "message" => "pattern" }
            remove_field => ["message","@timestamp"]
        }
    } else if "ERROR" in [message]{
       ...
    }

    mutate {
	    convert => {
            "myfield" => "boolean"
            ...
        }
    }
}

output {
      stdout { codec=> rubydebug }
}

```

I have a "message" field and I use match in grok filter in a conditional format (there are multiple patterns in my log file) to seperate my fields and then I use remove\_field for "message". I have tested below solution but got no result. actually it does not parse my message and does not create fields. (\_grokparsefailure):

```
if "PersonId" in [message] and ![PersonId] {
             ruby {
                code => 'event.set("person_ID",nil)'
             }
    }

```

Can someone please explain help me with this? Thanks in advance!

---

<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:** [January 10, 2021, 1:25pm UTC](https://discuss.elastic.co/t/null-and-nil/258507/2 "2021-01-10T13:25:46Z")

</div>

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