From afe7869b198da9085cdd2a822fdd33dc1e9d5b96 Mon Sep 17 00:00:00 2001 From: Kaarina Tungseth Date: Thu, 9 Sep 2021 11:53:37 -0500 Subject: [PATCH] [DOCS] Adds preview to runtime fields (#110327) (#111764) * [DOCS] Adds preview to runtime fields * Final draft changes * Review comments --- ...ent-indexPatterns-pinRuntimeField-7.15.png | Bin 0 -> 4334 bytes .../management/manage-index-patterns.asciidoc | 46 +++++++++--------- 2 files changed, 23 insertions(+), 23 deletions(-) create mode 100644 docs/management/images/stackManagement-indexPatterns-pinRuntimeField-7.15.png diff --git a/docs/management/images/stackManagement-indexPatterns-pinRuntimeField-7.15.png b/docs/management/images/stackManagement-indexPatterns-pinRuntimeField-7.15.png new file mode 100644 index 0000000000000000000000000000000000000000..49d0d4caec00f8dd1c3cd246dbfabe07104fdc51 GIT binary patch literal 4334 zcmZ`*2RK|?*B(ZT9z8^l5^eM{M(=&}PLvr&8D%htE+j}qB8V0x+6@t-MF>$NTwQ|b zSC8IB|3;EO_x|_){(YW();epw?^=89y`J;zIHRhAR@rN zFPg}70082@5GpEAEfp0usIM0s;Q<2xG~-gz2%*N`=pruf4y!2ZJcxKUkja(}Fj98S zBN|dNQKr)5WiQBeRDt>6k4D84mGIZ|<=?T4AEP9xRm0ptE79S=Yz4-kRrG=Prb73o zGtuyiEHC}O@NR{p4=5qPf^ecm7Jex(N${ywe$?5@wKy$58`fqZvm%~F#G-ehBiz}U zLDAXh(smk+J{`igh4EE5t^TuoWO={{6^QQd_@D$&3tp)NpdCGjwk9Pn^zCQf5c(DTer zxw_Q2_KO4{FdNEC!&B_RE`=kVfeXMmbi-vR00&_Jp`5vHt{`g3{V@uHApQ~@zTE&} z0CzLh7_P=FF(eX11Yl>wZI4hDX7!E)ICG|e@N`J_vm5w>?Iqygm7PPx~z zaF?68yvZi<&@G$;WGBr!!lcvDhD1@`lsEDf!Ab1S1YZ>sDS^AOxVgf-#M<|aa{V;% zy7CGK+)D8HV)$~Wpk#hDV4Upea>eW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Ntvs?0_FuYzxQ}LqNaVNuHSTRQ(mU`JQR1Dw$}K)tL0VQ!CM2 z1V~vXduCX0xt>sH=B?-rCyXSsDc|GUUkK0rte^y9p;78>i6Y#YeJ!VIeV59R^75Md z`)Uq#KJKs1;V07`QrVmOQl{H2>pgw%w=$2Kg2XcBPuMS_7s=;H+bAbLrWYY*Q^h4j zb{2gJ_N&9GD5l5vqCSVjKYuAs3e4^^sGjhILU6NGeUqA4bInQ}g6mWJ5+zb626mMD zDcWSwTRy^06N~(#t=aY;@MAF|=6sGL2`?|+zl-}i?EhKc?62c6(K{H}bdSUN0ikpv z&~};haMGy#2@QB@b$NU4n1C-u3%CC6gQ@E|EopD8>uUUf9gf$Pl;L`&NZs-^f{b2n zBxtJrm?Z5EMJ%T;_tf}BWWt_5By1l_DW)!|&E~nTYN4ygOq&2+zJ24*FJCc+w+-@5 zDtX6M>lPYV*&~Bif}XgZIS@m@|vGqq-nxuD;TG% zu=cAM>aWAMTit3ochbG^^Mw5hbozIan#xcKWMs)@{FV{KQk&pT0uJH z(x{F^uP1jE2}pfaVllA5KbAtBnYZW2H<>n(ykaKT>-poYU8B-F8#;+nj^yQM{YC3+ xkN0GP16LO6_AB>cJ$amP7d{^L4r!yqb0EeNQR*xkarHL_XsPL|mMh> and <>. . Open the main menu, then click *Stack Management > Index Patterns*. . Select the index pattern you want to add the runtime field to, then click *Add field*. -. Enter a *Name* for the runtime field, then select the field *Type*. +. Enter the field *Name*, then select the *Type*. -. Select *Set value*, then define the field value by emitting a single value using the {ref}/modules-scripting-painless.html[Painless scripting language]. -+ -The script must match the field *Type*, or the script fails. +. Select *Set custom label*, then enter the label you want to display where the index pattern is used, such as *Discover*. + +. Select *Set value*, then define the script. The script must match the *Type*, or the index pattern fails anywhere it is used. + +. To help you define the script, use the *Preview*: + +* To view the other available fields, use the *Document ID* arrows. + +* To filter the fields list, enter the keyword in *Filter fields*. + +* To pin frequently used fields to the top of the list, hover over the field, then click image:images/stackManagement-indexPatterns-pinRuntimeField-7.15.png[Icon to pin field to the top of the list]. . Click *Create field*. -+ -For information on how to create runtime fields in *Discover*, refer to <>. -+ -For information on how to create runtime fields in *Lens*, refer to <>. [float] [[runtime-field-examples]] ==== Runtime field examples -Try the runtime field examples on your own using the *Sample web logs* data index pattern. +Try the runtime field examples on your own using the <> data index pattern. [float] [[simple-hello-world-example]] ==== Return a keyword value -To return `Hello World!` value: +Return `Hello World!`: [source,text] ---- @@ -101,7 +101,7 @@ emit(""); [[replace-nulls-with-blanks]] ===== Replace nulls with blanks -Replace null values with none values: +Replace `null` values with `None`: [source,text] ---- @@ -115,7 +115,7 @@ else { } ---- -Specify operating system condition: +Specify the operating system condition: [source,text] ----