/AWS1/IF_CWL=>CREATESCHEDULEDQUERY()¶
About CreateScheduledQuery¶
Creates a new Scheduled Query that runs CloudWatch Logs Insights queries on a schedule and delivers results to specified destinations.
Method Signature¶
METHODS /AWS1/IF_CWL~CREATESCHEDULEDQUERY
IMPORTING
!IV_NAME TYPE /AWS1/CWLSCHEDULEDQUERYNAME OPTIONAL
!IV_DESCRIPTION TYPE /AWS1/CWLSCHEDULEDQUERYDESC OPTIONAL
!IV_QUERYLANGUAGE TYPE /AWS1/CWLQUERYLANGUAGE OPTIONAL
!IV_QUERYSTRING TYPE /AWS1/CWLQUERYSTRING OPTIONAL
!IT_LOGGROUPIDENTIFIERS TYPE /AWS1/CL_CWLSCHDQUERYLOGGRID00=>TT_SCHEDULEDQUERYLOGGROUPIDS OPTIONAL
!IV_SCHEDULEEXPRESSION TYPE /AWS1/CWLSCHEDULEEXPRESSION OPTIONAL
!IV_TIMEZONE TYPE /AWS1/CWLSCHEDULETIMEZONE OPTIONAL
!IV_STARTTIMEOFFSET TYPE /AWS1/CWLSTARTTIMEOFFSET OPTIONAL
!IO_DESTINATIONCONFIGURATION TYPE REF TO /AWS1/CL_CWLDESTINATIONCONF OPTIONAL
!IV_SCHEDULESTARTTIME TYPE /AWS1/CWLTIMESTAMP OPTIONAL
!IV_SCHEDULEENDTIME TYPE /AWS1/CWLTIMESTAMP OPTIONAL
!IV_EXECUTIONROLEARN TYPE /AWS1/CWLROLEARN OPTIONAL
!IV_STATE TYPE /AWS1/CWLSCHEDULEDQUERYSTATE OPTIONAL
!IT_TAGS TYPE /AWS1/CL_CWLTAGS_W=>TT_TAGS OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_cwlcreschddqueryrsp
RAISING
/AWS1/CX_CWLACCESSDENIEDEX
/AWS1/CX_CWLCONFLICTEXCEPTION
/AWS1/CX_CWLINTERNALSERVEREX
/AWS1/CX_CWLRESOURCENOTFOUNDEX
/AWS1/CX_CWLSERVICEQUOTAEXCDEX
/AWS1/CX_CWLTHROTTLINGEX
/AWS1/CX_CWLVALIDATIONEX
/AWS1/CX_CWLCLIENTEXC
/AWS1/CX_CWLSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_name TYPE /AWS1/CWLSCHEDULEDQUERYNAME /AWS1/CWLSCHEDULEDQUERYNAME¶
A unique name for the scheduled query within the region for an AWS account. The name can contain letters, numbers, underscores, hyphens, forward slashes, periods, and hash symbols.
iv_querylanguage TYPE /AWS1/CWLQUERYLANGUAGE /AWS1/CWLQUERYLANGUAGE¶
The query language to use for the scheduled query. Valid values are LogsQL (CloudWatch Logs Insights query language), PPL (OpenSearch Service Piped Processing Language), and SQL (OpenSearch Service Structured Query Language).
iv_querystring TYPE /AWS1/CWLQUERYSTRING /AWS1/CWLQUERYSTRING¶
The CloudWatch Logs Insights query string to execute. This is the actual query that will be run against your log data on the specified schedule.
iv_scheduleexpression TYPE /AWS1/CWLSCHEDULEEXPRESSION /AWS1/CWLSCHEDULEEXPRESSION¶
A cron expression that defines when the scheduled query runs. The format is cron(fields) where fields consist of six space-separated values: minutes, hours, day_of_month, month, day_of_week, year.
iv_executionrolearn TYPE /AWS1/CWLROLEARN /AWS1/CWLROLEARN¶
The Amazon Resource Name (ARN) of the IAM role that CloudWatch Logs will assume to execute the scheduled query and deliver results to the specified destinations.
Optional arguments:¶
iv_description TYPE /AWS1/CWLSCHEDULEDQUERYDESC /AWS1/CWLSCHEDULEDQUERYDESC¶
An optional description for the scheduled query to help identify its purpose.
it_loggroupidentifiers TYPE /AWS1/CL_CWLSCHDQUERYLOGGRID00=>TT_SCHEDULEDQUERYLOGGROUPIDS TT_SCHEDULEDQUERYLOGGROUPIDS¶
The log group identifiers to query. You can specify log group names or log group ARNs. If querying log groups in a source account from a monitoring account, you must specify the ARN of the log group.
iv_timezone TYPE /AWS1/CWLSCHEDULETIMEZONE /AWS1/CWLSCHEDULETIMEZONE¶
The timezone in which the schedule expression is evaluated. If not provided, defaults to UTC.
iv_starttimeoffset TYPE /AWS1/CWLSTARTTIMEOFFSET /AWS1/CWLSTARTTIMEOFFSET¶
Time offset in seconds from the execution time for the start of the query time range. This defines the lookback period for the query (for example, 3600 for the last hour).
io_destinationconfiguration TYPE REF TO /AWS1/CL_CWLDESTINATIONCONF /AWS1/CL_CWLDESTINATIONCONF¶
Configuration for destinations where the query results will be delivered after successful execution. You can configure delivery to S3 buckets or EventBridge event buses.
iv_schedulestarttime TYPE /AWS1/CWLTIMESTAMP /AWS1/CWLTIMESTAMP¶
The start time for the query schedule in Unix epoch time (seconds since January 1, 1970, 00:00:00 UTC). If not specified, the schedule starts immediately.
iv_scheduleendtime TYPE /AWS1/CWLTIMESTAMP /AWS1/CWLTIMESTAMP¶
The end time for the query schedule in Unix epoch time (seconds since January 1, 1970, 00:00:00 UTC). If not specified, the schedule runs indefinitely.
iv_state TYPE /AWS1/CWLSCHEDULEDQUERYSTATE /AWS1/CWLSCHEDULEDQUERYSTATE¶
The initial state of the scheduled query. Valid values are ENABLED (the query will run according to its schedule) and DISABLED (the query is paused and will not run). If not provided, defaults to ENABLED.
it_tags TYPE /AWS1/CL_CWLTAGS_W=>TT_TAGS TT_TAGS¶
An optional list of key-value pairs to associate with the resource.
For more information about tagging, see Tagging Amazon Web Services resources
RETURNING¶
oo_output TYPE REF TO /aws1/cl_cwlcreschddqueryrsp /AWS1/CL_CWLCRESCHDDQUERYRSP¶
Domain /AWS1/RT_ACCOUNT_ID Primitive Type NUMC
Examples¶
Syntax Example¶
This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.
DATA(lo_result) = lo_client->createscheduledquery(
io_destinationconfiguration = new /aws1/cl_cwldestinationconf(
io_s3configuration = new /aws1/cl_cwls3configuration(
iv_destinationidentifier = |string|
iv_rolearn = |string|
)
)
it_loggroupidentifiers = VALUE /aws1/cl_cwlschdqueryloggrid00=>tt_scheduledqueryloggroupids(
( new /aws1/cl_cwlschdqueryloggrid00( |string| ) )
)
it_tags = VALUE /aws1/cl_cwltags_w=>tt_tags(
(
VALUE /aws1/cl_cwltags_w=>ts_tags_maprow(
value = new /aws1/cl_cwltags_w( |string| )
key = |string|
)
)
)
iv_description = |string|
iv_executionrolearn = |string|
iv_name = |string|
iv_querylanguage = |string|
iv_querystring = |string|
iv_scheduleendtime = 123
iv_scheduleexpression = |string|
iv_schedulestarttime = 123
iv_starttimeoffset = 123
iv_state = |string|
iv_timezone = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lv_arn = lo_result->get_scheduledqueryarn( ).
lv_scheduledquerystate = lo_result->get_state( ).
ENDIF.