Skip to content

Commit db4ed95

Browse files
committed
Add Ingest\ProcessorGrok endpoint
1 parent 10ca829 commit db4ed95

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
3+
namespace Elasticsearch\Endpoints\Ingest\Pipeline;
4+
5+
use Elasticsearch\Common\Exceptions;
6+
use Elasticsearch\Endpoints\AbstractEndpoint;
7+
8+
/**
9+
* Class ProcessorGrok
10+
*
11+
* @category Elasticsearch
12+
* @package Elasticsearch\Endpoints\Ingest
13+
* @author Zachary Tong <[email protected]>
14+
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
15+
* @link http://elastic.co
16+
*/
17+
class ProcessorGrok extends AbstractEndpoint
18+
{
19+
/**
20+
* @throws \Elasticsearch\Common\Exceptions\RuntimeException
21+
* @return string
22+
*/
23+
public function getURI()
24+
{
25+
return "/_ingest/processor/grok";
26+
}
27+
28+
/**
29+
* @return string[]
30+
*/
31+
public function getParamWhitelist()
32+
{
33+
return [];
34+
}
35+
36+
/**
37+
* @return string
38+
*/
39+
public function getMethod()
40+
{
41+
return 'GET';
42+
}
43+
}

src/Elasticsearch/Namespaces/IngestNamespace.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Elasticsearch\Endpoints\Ingest\Pipeline\Delete;
66
use Elasticsearch\Endpoints\Ingest\Pipeline\Get;
7+
use Elasticsearch\Endpoints\Ingest\Pipeline\ProcessorGrok;
78
use Elasticsearch\Endpoints\Ingest\Pipeline\Put;
89
use Elasticsearch\Endpoints\Ingest\Simulate;
910

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

112113
return $this->performRequest($endpoint);
113114
}
115+
116+
/**
117+
* $params[]
118+
*
119+
* @param $params array Associative array of parameters
120+
*
121+
* @return array
122+
*/
123+
public function processorGrok($params = [])
124+
{
125+
/** @var callback $endpointBuilder */
126+
$endpointBuilder = $this->endpoints;
127+
128+
/** @var ProcessorGrok $endpoint */
129+
$endpoint = $endpointBuilder('Ingest\ProcessorGrok');
130+
131+
return $this->performRequest($endpoint);
132+
}
114133
}

0 commit comments

Comments
 (0)