Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensuring logs make it to Graylog server #7

Open
mtotheikle opened this issue May 20, 2015 · 4 comments
Open

Ensuring logs make it to Graylog server #7

mtotheikle opened this issue May 20, 2015 · 4 comments

Comments

@mtotheikle
Copy link

I'm just getting started with Graylog and fluent but is there any way to ensure logs get delivered to the Graylog server even if the Graylog server is temporarily unreachable? Thanks!

@emsearcy
Copy link
Owner

fluentd should take care of this automatically. out_gelf is a "buffered plugin", which means that it maintains an internal queue of "chunks" (a chunk is a collection of events), which it buffers (by default) to memory, and it tries to send these to the Graylog server but will retry if it encounters an error. (See http://docs.fluentd.org/articles/output-plugin-overview#list-of-buffered-output-plugins for more info on tuning buffering including the size of the buffer and how long to retry.)

However, it would be great if you could confirm this behavior is working for you, and let me know if you seem to be loosing any messages!

@mtotheikle
Copy link
Author

Thank you @emsearcy for confirming what I was expecting.

I can't seem to get the expected behavior out of this though. I have tested by shutting down an input within the Graylog cluster. This input is what my Fluent configuration is set to write to and when this input is not available it seems like the generated logs during that period are lost since when the input comes back up no information during that period is available within Graylog.

My configuration file looks like this:

<source>
    type tail
    format nginx
    path /var/log/nginx/access.log
    tag graylog2.nginx
  </source>
  <match graylog2.**>
    type copy
    <store>
      type gelf
      host x.x.x.x
      port 12201
      flush_interval 5s
      buffer_type file
      buffer_path /var/log/td-agent/buffer/nginx
    </store>
    <store>
      type stdout
    </store>
  </match>

I've also attempted a in memory buffer like so:

<source>
    type tail
    format nginx
    path /var/log/nginx/access.log
    tag graylog2.nginx
  </source>
  <match graylog2.**>
    type copy
    <store>
      type gelf
      host x.x.x.x
      port 12201
      flush_interval 5s
    </store>
    <store>
      type stdout
    </store>
  </match>

@emsearcy
Copy link
Owner

emsearcy commented Mar 7, 2017

Can you try using TCP to connect to Graylog?
(protocol tcp)

UDP is stateless (fire and forget) so there isn't any error checking to see if a GELF packet was received or not.

@KevDBG
Copy link

KevDBG commented Jun 22, 2018

Hello,

It's works with TCP, but there is a new problem comment here #28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants