How to Configure a Scheduled Task in Cortex XSOAR

How to Configure a Scheduled Task in Cortex XSOAR

3969
Created On 04/01/20 17:42 PM - Last Modified 04/07/21 14:00 PM


Objective
You can run a command according to a recurring schedule, setting the start time, end time, and frequency. Some common use cases for scheduling a command to run include:
  • Mirror a ticket from an external ticketing system.
  • Send an email to a user, wait a certain amount of time, and if a response is not received, send the email again.
The example we will use for demonstration is the !Print command.

Important Notes
  • Cron follows the time of the server that the script is running on.
  • The clock icon for the task is blue when it is not scheduled, and orange when it is scheduled.
Unscheduled
Unscheduled task

Scheduled
Scheduled task


Environment
Cortex XSOAR

Procedure
Input
 
ArgumentDescriptionRequired
commandCommand to scheduleRequired
cronScheduled time for the command to run (in Cron format)Required
endDateEnd time for the schedule to end (in Mon, 02 Jan 2019 15:04:04 EST format)Optional
timesNumber of times to run the commandOptional

Command Entries (UI)
  1. Locate the command entry in the War Room and click the clock icon.
  2. Configure the schedule for the task.
 
OptionDescription
Human View
  • Select whether you want this as a recurring task.
  • Define the frequency that this task will run.
  • Define the start time and end time for the task.
  • To delete the task schedule, click Remove schedule
Cron View
  • Select whether you want this as a recurring task.
  • Define the Cron expression (there are examples for reference).
  • Define the start time and end time for the task.
  • To delete the task schedule, click Remove schedule

Human View
 
Configure the schedule for the task human view

Cron View
 
Configure the schedule for the task cron view


Demisto CLI
 
For this example, we use the two required arguments (command and cron) and an optional argument (times).

!ScheduleCommand command="!Print value=\"qqq\"" cron="*****" times="3"

For this example, we use the two required arguments (command and cron) and an optional argument (times).

Script
 
 return executeCommand("ScheduleCommand", {
    'command': "!Print value=\"qqq\"",
    'cron': '* * * * *',
    'times': 3
}


Actions
  • Print
  • Copy Link

    https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA10g000000PPOaCAO&lang=en_US%E2%80%A9&refURL=http%3A%2F%2Fknowledgebase.paloaltonetworks.com%2FKCSArticleDetail&refURL=http%3A%2F%2Fknowledgebase.paloaltonetworks.com%2FKCSArticleDetail

Attachments
Choose Language