GithubHelp home page GithubHelp logo

Comments (10)

fbaligand avatar fbaligand commented on June 9, 2024

Hi @alkuzad,

It's odd to see that I had exactly the same problem (and idea) than you, nearly in the same time :)

To fix the problem, I suggest to do exactly the same thing that this code :
https://github.com/logstash-plugins/logstash-filter-ruby/blob/master/lib/logstash/filters/ruby.rb#L40

It allows to keep logstash up (and not crash logstash), log error when it occurs with @code section, and tag the event that caused the problem.

Makes sense to you ?

I consider to code it and make the pull request for it this thurday, in the evening.

from logstash-filter-aggregate.

alkuzad avatar alkuzad commented on June 9, 2024

Hi @fbaligand

Yes this is even better :) I personally extended the printout to include current map and event @data to find out errors quickly but I do not know if the @logger.error should add event automatically.

from logstash-filter-aggregate.

fbaligand avatar fbaligand commented on June 9, 2024

@alkuzad Can you put your code here ?

from logstash-filter-aggregate.

alkuzad avatar alkuzad commented on June 9, 2024

Hi @fbaligand

It's something like this:

begin
  @codeblock.call(event, map)
rescue => exception
  raise RuntimeError.new("There is an error with \n#{@code}\n, Error:\n#{exception}, Map: #{map}, EventData: #{event.instance_variable_get('@data')}")
end
input{
  stdin {}
}

filter{
  grok{
    match => { "[message]" => "%{NUMBER:id};(?<foo>.*)" }
  }

  if [id] {
    aggregate {
        task_id => "test_%{id}"
        code => "fail 'Asd';"
        map_action => "create"
        end_of_task => true
      }
  }
}

output {
  stdout { codec => rubydebug }
}

from logstash-filter-aggregate.

fbaligand avatar fbaligand commented on June 9, 2024

Thank you @alkuzad.

I will draw inspiration from your code to log error.

from logstash-filter-aggregate.

fbaligand avatar fbaligand commented on June 9, 2024

@alkuzad
The issue is now fixed.

To get it using logstash 1.5, use aggregate plugin version 0.1.4.
To get it using logstash 2.0, use aggregate plugin version 2.0.2.

Feel free to give feedback :)

from logstash-filter-aggregate.

alkuzad avatar alkuzad commented on June 9, 2024

@fbaligand thanks for fixing that :) I will check that when I'm done with fixing my ELK ansible setup :)

from logstash-filter-aggregate.

fbaligand avatar fbaligand commented on June 9, 2024

@alkuzad
OK. Let me know when you will check :)

from logstash-filter-aggregate.

alkuzad avatar alkuzad commented on June 9, 2024

Just playing with ELK again, works like a charm :)

from logstash-filter-aggregate.

fbaligand avatar fbaligand commented on June 9, 2024

Nice to hear that !

from logstash-filter-aggregate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.