使用jq表达式进行json模式匹配的wishbone流模块。

wishbone-flow-jq的Python项目详细描述


          __       __    __
.--.--.--|__.-----|  |--|  |--.-----.-----.-----.
|  |  |  |  |__ --|     |  _  |  _  |     |  -__|
|________|__|_____|__|__|_____|_____|__|__|_____|
                                   version 2.2.0

Build composable event pipeline servers with minimal effort.



================
wishbone.flow.jq
================

Version: 1.0.0

JSON pattern matching using jq expressions.
-------------------------------------------


    Evalutes (JSON) data structures against a set of jq expressions to decide
    which queue to forward the event to.

    JQ expressions
    --------------

    More information about jq expressions can be found here:

        - https://stedolan.github.io/jq/manual/


    Jq expressions need to return either **True** or **False**, otherwise this
    module will consider the result to be invalid and therefor skip the
    condition.

    Module level conditions
    -----------------------

    The module accepts the <conditions> parameter which is a list of
    conditions to evaluate against each data structure coming in.
    Each condition should have following format:

    JSON-schema::

        {
        "type": "object",
        "properties": {
            "name": {
                "type": "string"
            },
            "expression": {
                "type": "string"
            },
            "queue": {
                "type": "string"
            },
            "payload": {
                "type": "object",
                "patternProperties": {
                    ".*": {
                        "type": [
                            "string",
                            "number"
                        ],
                    }
                }
            },
        },
        "required": ["name", "expression", "queue"],
        "additionalProperties": False
        }


    Example::

        { "name": "test",
          "expression": ".greeting | test( "hello" )",
          "queue": "outbox",
          "payload": {
            "@tmp.some.key": 1,
          }
        }

    Disk level conditions
    ---------------------

    The directory <location> contains the conditions in YAML format. One
    condition is one file.  Files not having '.yaml' extension are ignored.

    This directory is monitored for changes and automatically reloaded
    whenever something changes.

    The rules should have following format:

    JSON-schema::

        {
        "type": "object",
        "properties": {
            "expression": {
                "type": "string"
            },
            "queue": {
                "type": "string"
            },
            "payload": {
                "type": "object",
                "patternProperties": {
                    ".*": {
                        "type": [
                            "string",
                            "number"
                        ],
                    }
                }
            },
        },
        "required": ["expression", "queue"],
        "additionalProperties": False
        }

    Example::

        queue: nagios
        expression: '.type | test( "nagios" )'

    payload
    -------

    The payload is a dictionary where keys are wishbone event references.


    Parameters:

        - selection(str)("@data")
           |  The root part of the event to evaluate.
           |  Use an empty string to refer to the complete event.

        - conditions(dict)([])
           |  A dictionary consisting out of expression, queue, payload.

        - location(str)("")
           |  A directory containing rules.  This directory will be monitored
           |  for changes and automatically read for changes.
           |  An empty value disables this functionality.


    Queues:

        - inbox
           |  Incoming events.

        - no_match
           |  Events which did not match at least one rule.

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java MouseListener给出了show()方法的问题   java我希望我的庄家在21点游戏中选择何时抽牌时更加“聪明”   使用摆动的java面板   Elasticsearch 5在Java API中的自动完成实现   java如何使用mockito为静态方法类编写junit?   java xpath元素标识清理器xpath   java GridBagLayout:设置组件的位置   java在同一个线程中创建多个计时器会导致主线程延迟   inputText中的JavaJSFMySQL项目首先显示值,但在修改后(通过绑定)提交时,它传递了原始值   java向下投射和向上投射对象以及动态方法绑定   java Jackson错误:没有适合简单类的构造函数   java无法从jar存档加载文件   java无法使用spring引导应用程序在集群模式下运行camel:quartz2   java我们如何在安卓 11中获得所有图像?