You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/user/ppl/functions/collection.rst
+54Lines changed: 54 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -186,6 +186,60 @@ Example::
186
186
| 120 |
187
187
+--------+
188
188
189
+
SPLIT
190
+
-----
191
+
192
+
Description
193
+
>>>>>>>>>>>
194
+
195
+
Usage: split(str, delimiter) splits the string values on the delimiter and returns the string values as a multivalue field (array). Use an empty string ("") to split the original string into one value per character. If the delimiter is not found, returns an array containing the original string. If the input string is empty, returns an empty array.
196
+
197
+
Argument type: str: STRING, delimiter: STRING
198
+
199
+
Return type: ARRAY of STRING
200
+
201
+
Example::
202
+
203
+
os> source=people | eval test = 'buttercup;rarity;tenderhoof;dash', result = split(test, ';') | fields result | head 1
204
+
fetched rows / total rows = 1/1
205
+
+------------------------------------+
206
+
| result |
207
+
|------------------------------------|
208
+
| [buttercup,rarity,tenderhoof,dash] |
209
+
+------------------------------------+
210
+
211
+
os> source=people | eval test = '1a2b3c4def567890', result = split(test, 'def') | fields result | head 1
212
+
fetched rows / total rows = 1/1
213
+
+------------------+
214
+
| result |
215
+
|------------------|
216
+
| [1a2b3c4,567890] |
217
+
+------------------+
218
+
219
+
os> source=people | eval test = 'abcd', result = split(test, '') | fields result | head 1
220
+
fetched rows / total rows = 1/1
221
+
+-----------+
222
+
| result |
223
+
|-----------|
224
+
| [a,b,c,d] |
225
+
+-----------+
226
+
227
+
os> source=people | eval test = 'name::value', result = split(test, '::') | fields result | head 1
228
+
fetched rows / total rows = 1/1
229
+
+--------------+
230
+
| result |
231
+
|--------------|
232
+
| [name,value] |
233
+
+--------------+
234
+
235
+
os> source=people | eval test = 'hello', result = split(test, ',') | fields result | head 1
0 commit comments