---
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-serverless/operation/operation-ingest-processor-grok
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch-serverless/operation/operation-ingest-processor-grok
products:
  - Elasticsearch Serverless
---

# Run a grok processor

Availability:

## Paths

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

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch-serverless/authentication#apikeyauth)

## 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.

[More about the Grok processor](https://www.elastic.co/docs/reference/enrich-processor/grok-processor)

## 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
```

