# KV with new lines

**URL:** <https://discuss.elastic.co/t/kv-with-new-lines/82989>\
**Category:** Logstash\
**Created:** [April 20, 2017, 6:51am UTC](https://discuss.elastic.co/t/kv-with-new-lines/82989 "2017-04-20T06:51:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rabbit](https://avatars.discourse-cdn.com/v4/letter/r/919ad9/32.png) [@rabbit](https://discuss.elastic.co/u/rabbit)\
**Post date:** [April 20, 2017, 6:51am UTC](https://discuss.elastic.co/t/kv-with-new-lines/82989/1 "2017-04-20T06:51:22Z")

</div>

I have the following log :

`2017-04-03 07:53:49,576 DEBUG [TESTING_DETAILS] -`  
`###ERROR DETAILS ###`

```
TestingError
CD Number: 12525
ID Testing: 20 NK 6969N5L
Message :Testing Failed TZE [L00141D]
URL Path: /TestingURL

```

How can I use the kv plugin to get the fields (cd number, id testing, Message and Url path) ?

I tried the following grok :

```
    grok
       {
            match => {"message"=> "%{TIMESTAMP_ISO8601:Data} %{DATA:ErrorBasicMessage}\n%{DATA:ErrorInfoSection}\n%{NOTSPACE:ErrorName}\n%{DATA:ErrorInfo}"}
       }
     mutate {
               gsub => ["Data", " ", "T"]
            }
    kv {
            source => "ErrorInfo"
            value_split => ":"
            field_split => "\n"
           }
```

---

<div class="post-metadata">

**Author:** ![jsvd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsvd/32/6203_2.png) [@jsvd](https://discuss.elastic.co/u/jsvd)\
**Post date:** [April 28, 2017, 3:22pm UTC](https://discuss.elastic.co/t/kv-with-new-lines/82989/2 "2017-04-28T15:22:56Z")

</div>

depending on which input+codec you use, the filters won't receive that block of text as a whole, but line by line (1 event per line).  
if you remove the filters and use only the `output { stdout { codec => rubydebug } }` with your input, can you see that 1 event contains the multi line string?

If not then you must use the multiline codec in the input, to generate a single event from all those lines, and then grok should work

---

<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:** [May 26, 2017, 3:28pm UTC](https://discuss.elastic.co/t/kv-with-new-lines/82989/3 "2017-05-26T15:28:17Z")

</div>

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