Coder Social home page Coder Social logo

Add a filter into rsyslog.conf about rsyslog HOT 4 OPEN

sous-chefs avatar sous-chefs commented on August 20, 2024
Add a filter into rsyslog.conf

from rsyslog.

Comments (4)

jeusdi avatar jeusdi commented on August 20, 2024

I figure out this option is not available by now, isn't it?

from rsyslog.

bby-bishopclark avatar bby-bishopclark commented on August 20, 2024

I think it's not available even now.

It's a very tricky thing to figure out, given the permutations of rulesets, and maybe no one's tackled it yet. I'm working on something similar, internally, but I expect it'll be so ugly that I won't want to release it -- even if it DOES work!

Consider writing your own, first as a template and then better as a LWRP or so, and see whether you can get something that's usable, versatile and, ideally, pretty.

from rsyslog.

sailorfred avatar sailorfred commented on August 20, 2024

While we wait for a better solution, here are a couple of workarounds:

To override the rsyslog.conf.erb template from a different cookbook: https://syshero.org/2013-11-22-override-templates-from-third-party-cookbooks-on/

This breaks the DRY principle, since your wrapper cookbook's rsyslog.conf.erb might drift over time.

Here's a horribly hacky way to do it without modifying the template or cookbook (in an attribute rb file):

# The sous-chef rsyslog cookbook doesn't allow the rsyslog.conf.erb file
# from another cookbook to be pointed to by an attribute. :(
# So we're going to do a horrible hack to get the filters loaded
# before the modules
if node['rsyslog'].key?('filter_msg_contains')
  override['rsyslog']['preserve_fqdn'] << "\n\n# Filters from attributes. This needs to happen
# before any output modules are loaded so will affect local logging too\n"
  node['rsyslog']['filter_msg_contains'].each do |f|
    override['rsyslog']['preserve_fqdn'] << ":msg, contains, \"#{f}\" ~\n"
  end
end

from rsyslog.

sailorfred avatar sailorfred commented on August 20, 2024

Another option is to pay attention to an attribute that defines a pre-module include directive

from rsyslog.

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.