Skip to content

Gateway

Abstract

The Punchplatform Gateway is a Restful service placed in front of the Punchplatform services such as Elasticsearch, Punchctl client for channels or PML jobs. It provides a transparency access to the Punchplatform features by an endpoint design for any external client.

image

Overview

The Punchplatform Gateway documentation for the REST api's endpoints is available in Reference Guide > Gateway.

On a Punchplatform standalone, run :

1
punchplatform-gateway.sh --start

You can now use the gateway with curl library or download Postman to send your requests to the Gateway.

Feature redirections

Elasticsearch

Elasticsearch cluster is accessible through /es.

The redirection respect requests transparency to Elasticsearch cluster. Each path matching the pattern /es/{cluster_name}/** will be directly redirected to the cluster.

Example :

1
2
curl localhost:4242/v1/mytenant/es/es_search/_cat/indices
curl -XPUT localhost:4242/v1/mytenant/es/es_search/newindex

Puncher

The Puncher tool for punchlets processing is accessible through /puncher.

It allows a client to directly execute a grok or a dissect operator on inputs, or execute a complete punchlet over a log file.

Examples :

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# grok operator on input
curl -XPOST localhost:4242/v1/puncher/grok \
  -F input=@/tmp/inputfile \
  -F pattern=@/tmp/patternfile
# dissect operator on input
curl -XPOST localhost:4242/v1/puncher/dissect \
  -F input=@/tmp/inputfile \
  -F pattern=@/tmp/patternfile
# execute punchlet
curl -XPOST localhost:4242/v1/puncher/dissect \
  -F input=@/tmp/inputfile \
  -F logFile=@/tmp/logfile

API Documentation

You can check the API documentation for more information.

The associated javadoc is a part of the user documentation, though some of it targets only the developers community :