forked from demisto/content
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook-RegexGroups_Test.yml
354 lines (354 loc) · 6.91 KB
/
playbook-RegexGroups_Test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
id: RegexGroups Test
version: -1
name: RegexGroups Test
starttaskid: "0"
tasks:
"0":
id: "0"
taskid: 30f8460b-5a57-45ad-80ee-311122ca6816
type: start
task:
id: 30f8460b-5a57-45ad-80ee-311122ca6816
version: -1
name: ""
iscommand: false
brand: ""
nexttasks:
'#none#':
- "1"
separatecontext: false
view: |-
{
"position": {
"x": 265,
"y": 50
}
}
note: false
"1":
id: "1"
taskid: cb35c1a2-af3b-4965-8a78-e80c0581b25a
type: regular
task:
id: cb35c1a2-af3b-4965-8a78-e80c0581b25a
version: -1
name: Set test data
description: Sets a value into the context with the given context key
scriptName: Set
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "5"
scriptarguments:
append: {}
key:
simple: TestData
value:
simple: The quick brown fox
separatecontext: false
view: |-
{
"position": {
"x": 265,
"y": 195
}
}
note: false
"2":
id: "2"
taskid: 261af029-dddb-4183-8354-eff3f0fada49
type: regular
task:
id: 261af029-dddb-4183-8354-eff3f0fada49
version: -1
name: Set test 2 output
description: Sets a value into the context with the given context key
scriptName: Set
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "9"
scriptarguments:
append: {}
key:
simple: Output
value:
complex:
root: TestData
transformers:
- operator: RegexGroups
args:
groups:
value:
simple: 0,1
keys:
value:
simple: article,noun
regex:
value:
simple: (The)\s(quick).*(fox)
separatecontext: false
view: |-
{
"position": {
"x": 265,
"y": 1185
}
}
note: false
"4":
id: "4"
taskid: e4e72a77-65bb-4855-837f-34ddfac9450d
type: title
task:
id: e4e72a77-65bb-4855-837f-34ddfac9450d
version: -1
name: Test 2 - with groups and keys
type: title
iscommand: false
brand: ""
nexttasks:
'#none#':
- "6"
separatecontext: false
view: |-
{
"position": {
"x": 265,
"y": 865
}
}
note: false
"5":
id: "5"
taskid: b8922c3d-ba0f-4bcf-8173-e012d39ee19c
type: title
task:
id: b8922c3d-ba0f-4bcf-8173-e012d39ee19c
version: -1
name: Test 1 - without groups and keys
type: title
iscommand: false
brand: ""
nexttasks:
'#none#':
- "7"
separatecontext: false
view: |-
{
"position": {
"x": 265,
"y": 370
}
}
note: false
"6":
id: "6"
taskid: 1a8ca9ce-cd6c-4749-8450-5617ff7f33b7
type: regular
task:
id: 1a8ca9ce-cd6c-4749-8450-5617ff7f33b7
version: -1
name: Delete Context
scriptName: DeleteContext
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "2"
scriptarguments:
all:
simple: "yes"
index: {}
key: {}
keysToKeep:
simple: TestData
subplaybook: {}
separatecontext: false
view: |-
{
"position": {
"x": 265,
"y": 1010
}
}
note: false
"7":
id: "7"
taskid: 3d8629e7-ac5a-4c39-821c-66bc68af8556
type: regular
task:
id: 3d8629e7-ac5a-4c39-821c-66bc68af8556
version: -1
name: Set test 1 output
scriptName: Set
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "8"
scriptarguments:
append: {}
key:
simple: Output
value:
complex:
root: TestData
transformers:
- operator: RegexGroups
args:
groups: {}
keys: {}
regex:
value:
simple: (The)\s(quick)
separatecontext: false
view: |-
{
"position": {
"x": 265,
"y": 515
}
}
note: false
"8":
id: "8"
taskid: e902bac7-ab6a-4539-8e70-87d8c229b6e1
type: regular
task:
id: e902bac7-ab6a-4539-8e70-87d8c229b6e1
version: -1
name: Verify test 1 output
scriptName: VerifyContext
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "4"
scriptarguments:
expectedValue:
simple: '["The","quick"]'
fields: {}
path:
simple: Output
separatecontext: false
view: |-
{
"position": {
"x": 265,
"y": 690
}
}
note: false
"9":
id: "9"
taskid: ab1fd458-eeb9-4f77-8ddf-2f4af4f0f079
type: condition
task:
id: ab1fd458-eeb9-4f77-8ddf-2f4af4f0f079
version: -1
name: Verify test 2 output
type: condition
iscommand: false
brand: ""
nexttasks:
'#default#':
- "11"
Passesd:
- "10"
separatecontext: false
conditions:
- label: Passesd
condition:
- - operator: isEqualString
left:
value:
simple: Output.article
iscontext: true
right:
value:
simple: The
- - operator: isEqualString
left:
value:
simple: Output.noun
iscontext: true
right:
value:
simple: quick
view: |-
{
"position": {
"x": 265,
"y": 1360
}
}
note: false
"10":
id: "10"
taskid: a34c587a-2f40-49e6-8d1a-ebf9789adb92
type: title
task:
id: a34c587a-2f40-49e6-8d1a-ebf9789adb92
version: -1
name: Success
type: title
iscommand: false
brand: ""
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 1550
}
}
note: false
"11":
id: "11"
taskid: 7c7b79e3-b7f9-4f45-897b-350dffb01fef
type: regular
task:
id: 7c7b79e3-b7f9-4f45-897b-350dffb01fef
version: -1
name: Failure
scriptName: RaiseError
type: regular
iscommand: false
brand: ""
scriptarguments:
actual: {}
details: {}
error:
simple: Test 2 output verification failed
expected: {}
separatecontext: false
view: |-
{
"position": {
"x": 480,
"y": 1535
}
}
note: false
view: |-
{
"linkLabelsPosition": {},
"paper": {
"dimensions": {
"height": 1580,
"width": 810,
"x": 50,
"y": 50
}
}
}
inputs: []
outputs: []