# Multiline codec reading entire log file as one line

**URL:** https://discuss.elastic.co/t/multiline-codec-reading-entire-log-file-as-one-line/86858
**Category:** Logstash
**Created:** [May 23, 2017, 7:07pm UTC](https://discuss.elastic.co/t/multiline-codec-reading-entire-log-file-as-one-line/86858 "2017-05-23T19:07:20Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Jaxon\_Kochel](https://avatars.discourse-cdn.com/v4/letter/j/da6949/32.png) [@Jaxon\_Kochel](https://discuss.elastic.co/u/Jaxon_Kochel)
#### Post date: [May 23, 2017, 7:07pm UTC](https://discuss.elastic.co/t/multiline-codec-reading-entire-log-file-as-one-line/86858/1 "2017-05-23T19:07:20Z")

</div>

Hello,

I'm having an issue with my multiline codec working correctly. Most of the lines in my file are a single line but some of them do have large stack traces in them at some points. When I run my config file the entire log is going into one message, it is not separating each line by its datestamp.

```
input {      
  file {
    
    path => "C:\Users\e-team\Documents\ELK\logs\coordinatorNode_0\logs\deployment2016-09-01T10.44.56.445-0500.log"

codec => multiline {
      # Grok pattern names are valid! :)
      pattern => "^%{DATESTAMP} "
      negate => true
      what => previous
    }
  
    start_position => "beginning"
  }
}

```

abbreviated filter section to the part I'm having the issue in:

```
filter{
if [path] =~ "deployment"{
      mutate { replace => { "type" => "DeployLog" } }

      mutate {
    gsub => ["message", "\n", ""]
   }

    grok{
      match => { "message" => "%{DATESTAMP:timestamp} %{LOGLEVEL:severity}\s* \[%{NOTSPACE:package}\] %{GREEDYDATA:message}"
      }

      match => { "message" => "(?m)%{DATESTAMP:timestamp} %{LOGLEVEL:severity}\s* \[%{NOTSPACE:package}\] %{GREEDYDATA:message}"
      overwrite => ["message"] 
      }
      
    }
   
    date {
    match => ["timestamp" , "yy-MM-dd HH:mm:ss,SSS"]
    target => "@timestamp"
    }
  }
}

```

**does this all look correct?**

some sample log lines - the last line is an abbreviated stack trace

```
2016-09-01 10:44:56,445 INFO [com.ServerStateLogger] Worker 60493 is Unsuspended
2016-09-01 10:44:56,445 INFO [com.ServerStateLogger] Worker 49696 is Unsuspended
2016-09-01 10:44:56,445 INFO [com.ServerStateLogger] --------------------------------------------------------------------
2016-09-01 10:44:56,445 INFO [comServerStateLogger] Queue State Summary
2016-09-01 10:45:11,460 ERROR [com.ServerStateLogger] Error attempting to log cluster state.
java.util.concurrent.TimeoutException: Futures timed out after [15 seconds]
	at scala.concurrent.impl.Promise$DefaultPromise.ready(Promise.scala:219)
	at scala.concurrent.impl.Promise$DefaultPromise.result(Promise.scala:223)
	at scala.concurrent.Await$$anonfun$result$1.apply(package.scala:116)
	at scala.concurrent.BlockContext$DefaultBlockContext$.blockOn(BlockContext.scala:53)
```

---

<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 20, 2017, 7:07pm UTC](https://discuss.elastic.co/t/multiline-codec-reading-entire-log-file-as-one-line/86858/2 "2017-06-20T19:07:31Z")

</div>

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