I am using next configuration file
input {
  stdin {
    codec => multiline {
      pattern => "%{APEX_TIMESTAMP}"
      negate => true
      what => "previous"
    }
  }
}
filter {
  grok {
    patterns_dir => ["/etc/logstash/patterns"]
    match => ["message", "%{APEX_TIMESTAMP:timestamp} %{LOGLEVEL:severity} %{GREEDYDATA:message}"]
  }
  date {
    timezone => "US/Pacific"
    match => ["timestamp" , "yyyy-MM-dd HH:mm:ss,SSS"]
  }
}
output {
      elasticsearch {
      hosts => ["localhost"]
    }
}
where
APEX_TIMESTAMP %{YEAR}-%{MONTHNUM}-%{MONTHDAY} %{HOUR}:%{MINUTE}:%{SECOND},\d{3}
as result I got 13 log messages from ~41,000 with _grokparsefailure. This is one of them
{
  "_index": "logstash-2016.09.16",
  "_type": "logs",
  "_id": "AVcw6Si2vjCqs-IM_UH9",
  "_score": null,
  "_source": {
    "@timestamp": "2016-09-16T02:52:49.123Z",
    "message": "2016-07-27 15:46:30,145 D\nEBUG  [defaultQuartzScheduler_Worker-21   ] [XpsMessageContext:204] (   ) [??????????] createXpsMessageTasks: { Message Task for UPDATE, table ID(34), entity(com.????????????), message key(34:70582107), entity gkey (?????????), mediator (class com.????????)}",
    "@version": "1",
    "tags": [
      "multiline",
      "_grokparsefailure"
    ],
    "host": "localhost.localdomain"
but the original message from log file does not have "\n" in DEBUG
[root@localhost Backup]# egrep '^2016-07-27 15:46:30,145 .*message key\(34:70582107\).*' navis-apex.log |od -c
0000000   2   0   1   6   -   0   7   -   2   7       1   5   :   4   6
0000020   :   3   0   ,   1   4   5       D   E   B   U   G           [
0000040   d   e   f   a   u   l   t   Q   u   a   r   t   z   S   c   h
0000060   e   d   u   l   e   r   _   W   o   r   k   e   r   -   2   1
Where did I make configuration mistake?
Thank you
