Code Monkey home page Code Monkey logo

Comments (8)

amateo avatar amateo commented on September 3, 2024

I have found that coding the yaml like:

  - expression_filter:
      filter:
        if:
          expression: '$hostname == ["sip", "proxysipint", "proxysipintb" ]'
          tasks:
            - set:
                '$.filename': '"kam-int.log"'
        "# else if 1\nelse if":
          expression: '$hostname == ["sipext", "proxysipext" ]'
          tasks:
            - set:
                '$.filename': '"kam-ext.log"'
        "# else if 2\nelse if":
          expression: '$hostname == ["pbxum", "pbxum1", "pbxum1b"]'
          tasks:
            - set:
                '$.filename': '"ast-core.log"'

worarounds the problem, but I can't find a better way

from puppet-rsyslog.

dhollinger avatar dhollinger commented on September 3, 2024

I'll take a look at what I can do. I have some ideas.

from puppet-rsyslog.

dhollinger avatar dhollinger commented on September 3, 2024

@amateo I pushed an update to master that changes how the expression filter YAML is formatted a little. It is still compatible with current formats, it just is designed to address the issue you ran into. Your workaround gave me the idea to name the conditions rather than try and rely on users putting the if, else if, and else in there.

see https://github.com/voxpupuli/puppet-rsyslog#expression-based-filters for some updated examples

I am planning on pushing up a release to the puppet forge either tonight or tomorrow if you'd rather wait for that than pull from git.

from puppet-rsyslog.

amateo avatar amateo commented on September 3, 2024

Thank you @dhollinger, I'll try it as soon as the new release is published.

from puppet-rsyslog.

amateo avatar amateo commented on September 3, 2024

@dhollinger, have you released it in the forge?

from puppet-rsyslog.

dhollinger avatar dhollinger commented on September 3, 2024

@amateo Not yet, will be before the end of the day (local time)

from puppet-rsyslog.

dhollinger avatar dhollinger commented on September 3, 2024

@amateo The release should be live now

from puppet-rsyslog.

amateo avatar amateo commented on September 3, 2024

Ok. Thank you.

from puppet-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.