Code Monkey home page Code Monkey logo

Comments (6)

pcfens avatar pcfens commented on August 15, 2024

Is Filebeat not starting correctly or not parsing the files correctly? Both formats are valid YAML arrays, but not all YAML parsers are the same. It's not hard to fix, but I want to make sure that there isn't some other error going on with the config file.

Any chance you can include the relevant part of your manifest that's creating the config file example you included?

from puppet-filebeat.

pcfens avatar pcfens commented on August 15, 2024

There's a chance that this is caused because the lines weren't wrapped in quotes. Could you try the include_exclude_fix branch to see if that works as expected too?

from puppet-filebeat.

mazilu88 avatar mazilu88 commented on August 15, 2024

Filebeat is not parsing the file correctly in the sense that it includes all of the entries in syslog, not just the ones in include_lines.
First try was with

  include_lines:
     - ["balbla\\["]
     - ["randomword"]

Second try did job

 include_lines: ["balbla\\[", "randomword"]

I did not had the time to test the other branch.

from puppet-filebeat.

pcfens avatar pcfens commented on August 15, 2024

I should have noticed the issue earlier - do you have any idea where the square brackets around "randomword" are coming from? They're not in the template, so I'm not sure where they're coming from.

Do you know what version of filebeat you're using, and a copy of the test manifest might help too since I'm not able to re-create the issue.

from puppet-filebeat.

mazilu88 avatar mazilu88 commented on August 15, 2024

The square brackets came from my declaration and it seems that it was the problem

include_lines  => [
      '["balbla\\["]',
      '["randomword"]',
]

But in that case it seemed to me that it should not match at all and not match all lines. Thus I thought it was a problem in the yaml that needed fixing. Sorry for wasting your time.

from puppet-filebeat.

pcfens avatar pcfens commented on August 15, 2024

I think that the square brackets made the YAML parser think that each line was an array. Wrapping the lines in quotes should help with that, so I'll merge in the branch as extra protection against problems like this in the future.

Thanks for helping find a weak point.

from puppet-filebeat.

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.