collector icon indicating copy to clipboard operation
collector copied to clipboard

Log-File input fails with content-splitter = PATTERN

Open trobers opened this issue 9 years ago • 19 comments

Hi,

with the following collector config

  graylog-server-log {
    type = "file"
    path = "/var/log/graylog-server/server.log"
    content-splitter = "PATTERN"
    content-splitter-pattern = "^\\d{4}-\\d{2}-\\d{2}T"
  }

the collector transmitted only the line 1 to 3. The log-line 4 would never send, because the pattern does not match.

2015-06-22T15:05:31.715+02:00 INFO  [Log] Rolled new log segment for 'messagejournal-0' in 1 ms.
2015-06-22T15:06:11.851+02:00 INFO  [Log] Scheduling log segment 2470544171 for log messagejournal-0 for deletion.
2015-06-22T15:07:11.851+02:00 INFO  [Log] Deleting segment 2470544171 from log messagejournal-0.
2015-06-22T15:07:11.894+02:00 INFO  [OffsetIndex] Deleting index /var/lib/graylog-server/journal/messagejournal-0/00000000002470544171.index.deleted

These log-line will only send if another log-line will be written to the logfile.

In this case for example it could be happen, that a panic message from an application never transmit to the graylog server.

Is there a solution for this case like a configuration item or something?

trobers avatar Jun 22 '15 13:06 trobers

This is currently a limitation of the pattern splitter. We will investigate if there is a good solution for this.

Thank you for the report!

bernd avatar Jun 22 '15 15:06 bernd

This is a critical roadblock for me in using the collector. It would be nice to see an option to include or exclude stack traces automatically. As it stands right now I can't do either effectively - if I use a newline I get every line of the trace thrown in as a separate entry. If I use a pattern splitter I don't get a message sent until the next message is logged - which in some cases for us could be days.

jamiegeyer avatar Aug 10 '15 19:08 jamiegeyer

The only workaround I currently see is to have some kind of timeout after which the buffer is flushed. I will look into this.

bernd avatar Aug 11 '15 08:08 bernd

I was thinking exactly the same thing. This would solve a bunch of problems for us.

Thanks!

jamiegeyer avatar Aug 11 '15 12:08 jamiegeyer

@jamiegeyer How did you implement the timeout?

dwightkjones2 avatar Aug 21 '15 14:08 dwightkjones2

Are there any updates on this issue; it may end up being a go or no-go for graylog. If the last log message is a critical one, we will never see it.

NathanChristie avatar Oct 21 '15 15:10 NathanChristie

Any updates on this? This can really allow missing something if logging only fires every few minutes, or worse, hours could pass before a message is fired to graylog.

BMacster avatar Oct 21 '15 15:10 BMacster

@NathanChristie We will fix this, yes. I cannot give you a date unfortunately. Regarding the Graylog go, no-go decision, you don't need the Collector to run Graylog. There are alternative log shippers that can send local log files to Graylog.

@BMacster As said, we will fix this eventually. Just can't give a date right now.

bernd avatar Oct 21 '15 15:10 bernd

I would also be very pleased if this bug would corrected shortly. My suggestion would be to use a configurable timer.

For example: pattern-timer = 5

If 5 seconds last "incomplete" Log event is nothing more happened in the log file transfer it.

keitopso avatar Oct 22 '15 18:10 keitopso

Finally I've found the reason of my problems. I will wait for this fix. Thanks @bernd!

ygorth avatar Feb 26 '16 21:02 ygorth

I'm going to give a +1 to @bernd's idea of having a buffer flush. If data exists in buffer between polling interval 1 and 2 and the content-splitter pattern does not appear in said buffer between those intervals flush the buffer.

Spitfire1900 avatar Feb 29 '16 16:02 Spitfire1900

This feature should not be recommended without a big warn sign in the docs. Some people may rely on it.

gn-ley avatar Apr 19 '16 13:04 gn-ley

Agree. I have spent way too much time troubleshooting my pattern before I figured out this issue.

ghost avatar Apr 19 '16 16:04 ghost

@bernd can we expect a fix this?

mohanrao avatar May 19 '16 18:05 mohanrao

@mohanrao The Graylog Collector has been deprecated. I recommend using nxlog or filebeat to ingest text files and them to Graylog.

joschi avatar May 20 '16 08:05 joschi

@joschi Both of them don't have support for AIX

mohanrao avatar May 20 '16 17:05 mohanrao

@mohanrao Logstash (using JRuby and thus running on AIX) could be another viable replacement in this case.

joschi avatar May 20 '16 17:05 joschi

@joschi Does Logstash has SSL ability? My another requirement is GELF TCP with SSL

mohanrao avatar May 20 '16 17:05 mohanrao

@mohanrao Please move this discussion to our public mailing list or join the #graylog channel on freenode IRC.

Thank you!

joschi avatar May 20 '16 17:05 joschi