Skip to content

Commit

Permalink
[DOCS] Move common scripting use cases up a level (elastic#73445)
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Locke committed May 27, 2021
1 parent e8a7ad5 commit aee6e05
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions docs/reference/scripting.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ include::scripting/painless.asciidoc[]

include::scripting/using.asciidoc[]

include::scripting/common-script-uses.asciidoc[]

include::scripting/fields.asciidoc[]

include::scripting/security.asciidoc[]
Expand Down
8 changes: 5 additions & 3 deletions docs/reference/scripting/common-script-uses.asciidoc
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
[[common-script-uses]]
=== Common scripting use cases
== Common scripting use cases
You can write a script to do almost anything, and sometimes, that's
the trouble. It's challenging to know what's possible with scripts,
so the following examples address common uses cases where scripts are
really helpful.

* <<scripting-field-extraction,Field extraction>>

[[scripting-field-extraction]]
==== Field extraction
=== Field extraction
The goal of field extraction is simple; you have fields in your data with a bunch of
information, but you only want to extract pieces and parts.

Expand Down Expand Up @@ -73,7 +75,7 @@ POST /my-index/_bulk?refresh

[discrete]
[[field-extraction-ip]]
===== Extract an IP address from a log message (Grok)
==== Extract an IP address from a log message (Grok)
If you want to retrieve results that include `clientip`, you can add that
field as a runtime field in the mapping. The following runtime script defines a
grok pattern that extracts structured fields out of the `message` field.
Expand Down
1 change: 0 additions & 1 deletion docs/reference/scripting/using.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -566,4 +566,3 @@ DELETE /_ingest/pipeline/my_test_scores_pipeline
////

include::common-script-uses.asciidoc[]

0 comments on commit aee6e05

Please sign in to comment.