Skip to content

Commit

Permalink
Add Ingest\ProcessorGrok endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
polyfractal committed Nov 14, 2017
1 parent dfd8c3c commit 800b1ec
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
43 changes: 43 additions & 0 deletions src/Elasticsearch/Endpoints/Ingest/ProcessorGrok.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

namespace Elasticsearch\Endpoints\Ingest\Pipeline;

use Elasticsearch\Common\Exceptions;
use Elasticsearch\Endpoints\AbstractEndpoint;

/**
* Class ProcessorGrok
*
* @category Elasticsearch
* @package Elasticsearch\Endpoints\Ingest
* @author Zachary Tong <zach@elastic.co>
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
* @link http://elastic.co
*/
class ProcessorGrok extends AbstractEndpoint
{
/**
* @throws \Elasticsearch\Common\Exceptions\RuntimeException
* @return string
*/
public function getURI()
{
return "/_ingest/processor/grok";
}

/**
* @return string[]
*/
public function getParamWhitelist()
{
return [];
}

/**
* @return string
*/
public function getMethod()
{
return 'GET';
}
}
19 changes: 19 additions & 0 deletions src/Elasticsearch/Namespaces/IngestNamespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Elasticsearch\Endpoints\Ingest\Pipeline\Delete;
use Elasticsearch\Endpoints\Ingest\Pipeline\Get;
use Elasticsearch\Endpoints\Ingest\Pipeline\ProcessorGrok;
use Elasticsearch\Endpoints\Ingest\Pipeline\Put;
use Elasticsearch\Endpoints\Ingest\Simulate;

Expand Down Expand Up @@ -111,4 +112,22 @@ public function simulate($params = array())

return $this->performRequest($endpoint);
}

/**
* $params[]
*
* @param $params array Associative array of parameters
*
* @return array
*/
public function processorGrok($params = [])
{
/** @var callback $endpointBuilder */
$endpointBuilder = $this->endpoints;

/** @var ProcessorGrok $endpoint */
$endpoint = $endpointBuilder('Ingest\ProcessorGrok');

return $this->performRequest($endpoint);
}
}

0 comments on commit 800b1ec

Please sign in to comment.