# Logstash KV filter escape ":"

**URL:** https://discuss.elastic.co/t/logstash-kv-filter-escape/304624
**Category:** Logstash
**Created:** [May 12, 2022, 10:23pm UTC](https://discuss.elastic.co/t/logstash-kv-filter-escape/304624 "2022-05-12T22:23:45Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Jim\_Thunder](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jim_thunder/32/45439_2.png) [@Jim\_Thunder](https://discuss.elastic.co/u/Jim_Thunder)
#### Post date: [May 12, 2022, 10:23pm UTC](https://discuss.elastic.co/t/logstash-kv-filter-escape/304624/1 "2022-05-12T22:23:45Z")

</div>

Hello, I have a message here (all message will be like this):

> {"Time": "2022-05-12T04:18:46.077", "HostName": "IBMNOAH", "Cat": "JOBLOG", "Severity": "Err", "SAF": 1, "SAFD": "RACF", "Name": "TEST", "JobName": "DBS1MSTR", "JobID": "JOB03954", "Rec": " 23:18:36 ERROR ID=DSNLIRTR000300000000000::172.31.206.121 FOR THREAD WITH"}

This is my code to parse properly:

```auto
filter {
    kv {
        value_split => ":"
        remove_char_value => ","
    }
}

```

The one issue I have is that the value of the final field, "Rec", contains colons `:` which throws off the kv{} filter. How can I escape those colons so the kv filter grabs everything inside the `""` for each key:value pair?

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [May 12, 2022, 10:54pm UTC](https://discuss.elastic.co/t/logstash-kv-filter-escape/304624/2 "2022-05-12T22:54:26Z")

</div>

As I said in the [other thread](https://discuss.elastic.co/t/field-parse-issue/304596/4), use a json filter, not a kv filter.

---

<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 9, 2022, 10:54pm UTC](https://discuss.elastic.co/t/logstash-kv-filter-escape/304624/3 "2022-06-09T22:54:57Z")

</div>

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