---
type: api
title: Run a grok processor
description: Extract structured fields out of a single text field within a document.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ingest-processor-grok
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ingest-processor-grok
products:
  - Elasticsearch
---

# Run a grok processor

Availability: 6.1+

## Paths

- `GET` `/_ingest/processor/grok`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/authentication#basicauth)
- [Bearer auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/authentication#bearerauth)

## Description

Extract structured fields out of a single text field within a document.
You must choose which field to extract matched fields from, as well as the grok pattern you expect will match.
A grok pattern is like a regular expression that supports aliased expressions that can be reused.

[Read the reference documentation](https://www.elastic.co/guide/en/elasticsearch/reference/8.19/grok-processor.html)

## Response

`application/json`

- `patterns` (map string to string)
## Code Examples

#### Console

```console
GET _ingest/processor/grok
```

#### JavaScript

```javascript
const response = await client.ingest.processorGrok();
```

#### Python

```python
resp = client.ingest.processor_grok()
```

#### curl

```curl
curl -X GET "$ELASTICSEARCH_URL/_ingest/processor/grok" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.ingest().processorGrok();
```

#### C#

```c#
var response = await client.Ingest.ProcessorGrokAsync();
```

#### PHP

```php
$resp = $client->ingest()->processorGrok();
```

#### Ruby

```ruby
response = client.ingest.processor_grok
```

