After having stored your pipeline, it is common to retrieve its content, for checking its definition. This action can be done via the get pipeline API.
You need an up-and-running Elasticsearch installation, as we described in the Downloading and installing Elasticsearch recipe in Chapter 2, Downloading and Setup.
To execute curl
via the command line, you need to install curl
for your operative system.
To retrieve an ingestion pipeline in Elasticsearch, we will perform the following steps:
GET
call:curl -XGET 'http://127.0.0.1:9200/_ingest/pipeline/add-user- john'
{ "add-user-john" : { "description" : "Add user john field", "processors" : [ { "set" : { "field" : "user", "value" : "john" } } ], "version" : 1 } }
To retrieve an ingestion pipeline, you need its name/ID.
For each returned pipeline, all the data is returned: the source and the version if it are defined.
The GET
pipeline allows us to use a wildcard in names, so you can:
*
:curl -XGET 'http://127.0.0.1:9200/_ingest/pipeline/*'
curl -XGET 'http://127.0.0.1:9200/_ingest/pipeline/add-*'
If you need only a part of the pipeline, such as the version, you can use the filter_path
to filter the pipeline only for the parts needed.
For example, using:
curl -XGET 'http://127.0.0.1:9200/_ingest/pipeline/add-user-john? filter_path=*.version'
It will return, only the version part of the pipeline:
{ "add-user-john" : { "version" : 1 } }
3.138.34.226