Skip to content

Commit c9be996

Browse files
authored
[DOCS] Sort option for the grok patterns endpoint (#62092) (#62982)
1 parent 068f605 commit c9be996

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

docs/reference/ingest/processors/grok.asciidoc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,33 @@ The above request will return a response body containing a key-value representat
308308
--------------------------------------------------
309309
// NOTCONSOLE
310310

311+
By default, the API returns patterns in the order they are read from disk. This
312+
sort order preserves groupings of related patterns. For example, all patterns
313+
related to parsing Linux syslog lines stay grouped together.
314+
315+
You can use the optional boolean `s` query parameter to sort returned patterns
316+
by key name instead.
317+
318+
[source,console]
319+
--------------------------------------------------
320+
GET _ingest/processor/grok?s
321+
--------------------------------------------------
322+
323+
The API returns the following response.
324+
325+
[source,js]
326+
--------------------------------------------------
327+
{
328+
"patterns" : {
329+
"BACULA_CAPACITY" : "%{INT}{1,3}(,%{INT}{3})*",
330+
"BACULA_DEVICE" : "%{USER}",
331+
"BACULA_DEVICEPATH" : "%{UNIXPATH}",
332+
...
333+
}
334+
--------------------------------------------------
335+
// NOTCONSOLE
336+
337+
311338
This can be useful to reference as the built-in patterns change across versions.
312339

313340
[[grok-watchdog]]

0 commit comments

Comments
 (0)