Validating ElasticSearch pipelines

Sometimes you only want to validate ElasticSearch pipelines without converting them into Mustash processors for later rendering. In order to do this, you can call validate_ingest_pipeline().

An example snippet doing precisely this is the following:

from __future__ import annotations

from mustash.es import validate_ingest_pipeline


raw_pipeline = {
    "name": "hello",
    "processors": [
        {"json": {"field": "message"}},
    ],
}

print(validate_ingest_pipeline(raw_pipeline))

The snippet above prints the following:

[{'json': {'field': 'message'}}]