forked from demisto/content
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook-FormattedDateToEpochTest.yml
568 lines (568 loc) · 11.6 KB
/
playbook-FormattedDateToEpochTest.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
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
id: FormattedDateToEpochTest
version: 10
name: FormattedDateToEpochTest
starttaskid: "0"
tasks:
"0":
id: "0"
taskid: b9afd8b5-96f7-49b4-81a9-409d7ce15406
type: start
task:
id: b9afd8b5-96f7-49b4-81a9-409d7ce15406
version: -1
name: ""
iscommand: false
brand: ""
nexttasks:
'#none#':
- "13"
separatecontext: false
view: |-
{
"position": {
"x": 602.5,
"y": 50
}
}
note: false
timertriggers: []
"1":
id: "1"
taskid: 77e962c5-7e72-4a3d-8419-edb07f578cbf
type: regular
task:
id: 77e962c5-7e72-4a3d-8419-edb07f578cbf
version: -1
name: Check 1991-05-20T20:37:43.000Z
description: Sets a value into the context with the given context key
scriptName: Set
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "3"
scriptarguments:
append: {}
key:
simple: TimeToCheck_1
value:
simple: 1991-05-20T20:37:43.000Z
separatecontext: false
view: |-
{
"position": {
"x": 602.5,
"y": 370
}
}
note: false
timertriggers: []
"3":
id: "3"
taskid: 8189ee47-c322-4ab0-88ce-5307a0dcb360
type: regular
task:
id: 8189ee47-c322-4ab0-88ce-5307a0dcb360
version: -1
name: Convert to Epoch 1
description: Sets a value into the context with the given context key
scriptName: Set
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "12"
scriptarguments:
append: {}
key:
simple: Epoch_1
value:
complex:
root: TimeToCheck_1
transformers:
- operator: FormattedDateToEpoch
args:
formatter:
value:
simple: '%Y-%m-%dT%H:%M:%S.%fZ'
separatecontext: false
view: |-
{
"position": {
"x": 602.5,
"y": 545
}
}
note: false
timertriggers: []
"4":
id: "4"
taskid: 7de6bc45-3ffa-4dce-8055-1b6a638dbc1c
type: regular
task:
id: 7de6bc45-3ffa-4dce-8055-1b6a638dbc1c
version: -1
name: Check 20:51:20
description: Sets a value into the context with the given context key
scriptName: Set
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "7"
scriptarguments:
append: {}
key:
simple: TimeToCheck_3
value:
simple: "20:51:20"
separatecontext: false
view: |-
{
"position": {
"x": 1165,
"y": 370
}
}
note: false
timertriggers: []
"5":
id: "5"
taskid: 4de18348-8498-428e-8470-0e4c08d3cba7
type: regular
task:
id: 4de18348-8498-428e-8470-0e4c08d3cba7
version: -1
name: Check 20-05-1991
description: Sets a value into the context with the given context key
scriptName: Set
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "6"
scriptarguments:
append: {}
key:
simple: TimeToCheck_2
value:
simple: 20-05-1991
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 370
}
}
note: false
timertriggers: []
"6":
id: "6"
taskid: ad9fe73f-5802-44fb-8dc4-a65d9f8e6331
type: regular
task:
id: ad9fe73f-5802-44fb-8dc4-a65d9f8e6331
version: -1
name: Convert to Epoch 2
description: Sets a value into the context with the given context key
scriptName: Set
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "11"
scriptarguments:
append: {}
key:
simple: Epoch_2
value:
complex:
root: TimeToCheck_2
transformers:
- operator: FormattedDateToEpoch
args:
formatter:
value:
simple: '%d-%m-%Y'
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 545
}
}
note: false
timertriggers: []
"7":
id: "7"
taskid: 8a67f5a2-4997-4c64-84b2-affa3806da00
type: regular
task:
id: 8a67f5a2-4997-4c64-84b2-affa3806da00
version: -1
name: Convert to Epoch 3
description: Sets a value into the context with the given context key
scriptName: Set
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "8"
scriptarguments:
append: {}
key:
simple: Epoch_3
value:
complex:
root: TimeToCheck_3
transformers:
- operator: FormattedDateToEpoch
args:
formatter:
value:
simple: '%H:%M:%S'
separatecontext: false
view: |-
{
"position": {
"x": 1165,
"y": 545
}
}
note: false
timertriggers: []
"8":
id: "8"
taskid: 328738a9-c2dc-4fc2-8cd7-f4e49a5a399e
type: condition
task:
id: 328738a9-c2dc-4fc2-8cd7-f4e49a5a399e
version: -1
name: Validate result 3
type: condition
iscommand: false
brand: ""
nexttasks:
'#default#':
- "10"
"yes":
- "14"
separatecontext: false
conditions:
- label: "yes"
condition:
- - operator: isEqualNumber
left:
value:
simple: ${Epoch_3}
iscontext: true
right:
value:
simple: "-2208913720"
view: |-
{
"position": {
"x": 1165,
"y": 720
}
}
note: false
timertriggers: []
"9":
id: "9"
taskid: d141d4f3-2567-460c-85df-75a099f14e98
type: title
task:
id: d141d4f3-2567-460c-85df-75a099f14e98
version: -1
name: Done
type: title
iscommand: false
brand: ""
separatecontext: false
view: |-
{
"position": {
"x": 602.5,
"y": 1225
}
}
note: false
timertriggers: []
"10":
id: "10"
taskid: e60e6ea4-a14a-474b-8b3a-62d31b0d7b9d
type: regular
task:
id: e60e6ea4-a14a-474b-8b3a-62d31b0d7b9d
version: -1
name: Error
description: Prints an error entry with a given message
scriptName: PrintErrorEntry
type: regular
iscommand: false
brand: ""
scriptarguments:
message:
simple: Conversion to epoch failed
separatecontext: false
view: |-
{
"position": {
"x": -380,
"y": 1130
}
}
note: false
timertriggers: []
"11":
id: "11"
taskid: cc7336f0-7aa0-407f-8418-ca6bc8f8f2e4
type: condition
task:
id: cc7336f0-7aa0-407f-8418-ca6bc8f8f2e4
version: -1
name: Validate result 2
type: condition
iscommand: false
brand: ""
nexttasks:
'#default#':
- "10"
"yes":
- "16"
separatecontext: false
conditions:
- label: "yes"
condition:
- - operator: isEqualNumber
left:
value:
simple: ${Epoch_2}
iscontext: true
right:
value:
simple: "674697600"
view: |-
{
"position": {
"x": 50,
"y": 720
}
}
note: false
timertriggers: []
"12":
id: "12"
taskid: f249a134-6e1b-41cb-8030-2fe096bdcf56
type: condition
task:
id: f249a134-6e1b-41cb-8030-2fe096bdcf56
version: -1
name: Validate result 1
type: condition
iscommand: false
brand: ""
nexttasks:
'#default#':
- "10"
"yes":
- "15"
separatecontext: false
conditions:
- label: "yes"
condition:
- - operator: isEqualNumber
left:
value:
simple: ${Epoch_1}
iscontext: true
right:
value:
simple: "674771863"
view: |-
{
"position": {
"x": 602.5,
"y": 720
}
}
note: false
timertriggers: []
"13":
id: "13"
taskid: be2ea045-f961-44c9-8196-e1a25bbe2b99
type: regular
task:
id: be2ea045-f961-44c9-8196-e1a25bbe2b99
version: -1
name: Start Clean
description: Delete field from context
scriptName: DeleteContext
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "5"
- "1"
- "4"
scriptarguments:
all:
simple: "yes"
index: {}
key: {}
keysToKeep: {}
subplaybook: {}
separatecontext: false
view: |-
{
"position": {
"x": 602.5,
"y": 195
}
}
note: false
timertriggers: []
"14":
id: "14"
taskid: bfccaae9-9902-4d80-8f70-83e62166ff05
type: condition
task:
id: bfccaae9-9902-4d80-8f70-83e62166ff05
version: -1
name: Convert back to ISO date 3
type: condition
iscommand: false
brand: ""
nexttasks:
'#default#':
- "10"
"yes":
- "9"
separatecontext: false
conditions:
- label: "yes"
condition:
- - operator: isEqualString
left:
value:
complex:
root: Epoch_3
transformers:
- operator: TimeStampToDate
iscontext: true
right:
value:
simple: 1900-01-01T20:51:20.000Z
view: |-
{
"position": {
"x": 1165,
"y": 895
}
}
note: false
timertriggers: []
"15":
id: "15"
taskid: d8580132-d0f3-4e50-88f6-0f6aa1141b45
type: condition
task:
id: d8580132-d0f3-4e50-88f6-0f6aa1141b45
version: -1
name: Convert back to ISO date 1
type: condition
iscommand: false
brand: ""
nexttasks:
'#default#':
- "10"
"yes":
- "9"
separatecontext: false
conditions:
- label: "yes"
condition:
- - operator: isEqualString
left:
value:
complex:
root: Epoch_1
transformers:
- operator: TimeStampToDate
iscontext: true
right:
value:
simple: 1991-05-20T20:37:43.000Z
view: |-
{
"position": {
"x": 602.5,
"y": 895
}
}
note: false
timertriggers: []
"16":
id: "16"
taskid: c8b82ef9-06b1-4c95-8d30-e610bc6e1b63
type: condition
task:
id: c8b82ef9-06b1-4c95-8d30-e610bc6e1b63
version: -1
name: Convert back to ISO date 2
type: condition
iscommand: false
brand: ""
nexttasks:
'#default#':
- "10"
"yes":
- "9"
separatecontext: false
conditions:
- label: "yes"
condition:
- - operator: isEqualString
left:
value:
complex:
root: Epoch_2
transformers:
- operator: TimeStampToDate
iscontext: true
right:
value:
simple: 1991-05-20T00:00:00.000Z
view: |-
{
"position": {
"x": 50,
"y": 895
}
}
note: false
timertriggers: []
view: |-
{
"linkLabelsPosition": {},
"paper": {
"dimensions": {
"height": 1240,
"width": 1925,
"x": -380,
"y": 50
}
}
}
inputs: []
outputs: []