Skip to content

/AWS1/CL_CWT=>GETINSIGHTRULEREPORT()

About GetInsightRuleReport

This operation returns the time series data collected by a Contributor Insights rule. The data includes the identity and number of contributors to the log group.

You can also optionally return one or more statistics about each data point in the time series. These statistics can include the following:

  • UniqueContributors -- the number of unique contributors for each data point.

  • MaxContributorValue -- the value of the top contributor for each data point. The identity of the contributor might change for each data point in the graph.

    If this rule aggregates by COUNT, the top contributor for each data point is the contributor with the most occurrences in that period. If the rule aggregates by SUM, the top contributor is the contributor with the highest sum in the log field specified by the rule's Value, during that period.

  • SampleCount -- the number of data points matched by the rule.

  • Sum -- the sum of the values from all contributors during the time period represented by that data point.

  • Minimum -- the minimum value from a single observation during the time period represented by that data point.

  • Maximum -- the maximum value from a single observation during the time period represented by that data point.

  • Average -- the average value from all contributors during the time period represented by that data point.

Method Signature

IMPORTING

Required arguments:

iv_rulename TYPE /AWS1/CWTINSIGHTRULENAME /AWS1/CWTINSIGHTRULENAME

The name of the rule that you want to see data from.

iv_starttime TYPE /AWS1/CWTTIMESTAMP /AWS1/CWTTIMESTAMP

The start time of the data to use in the report. When used in a raw HTTP Query API, it is formatted as yyyy-MM-dd'T'HH:mm:ss. For example, 2019-07-01T23:59:59.

iv_endtime TYPE /AWS1/CWTTIMESTAMP /AWS1/CWTTIMESTAMP

The end time of the data to use in the report. When used in a raw HTTP Query API, it is formatted as yyyy-MM-dd'T'HH:mm:ss. For example, 2019-07-01T23:59:59.

iv_period TYPE /AWS1/CWTPERIOD /AWS1/CWTPERIOD

The period, in seconds, to use for the statistics in the InsightRuleMetricDatapoint results.

Optional arguments:

iv_maxcontributorcount TYPE /AWS1/CWTINSIGHTRLUNBOUNDINT00 /AWS1/CWTINSIGHTRLUNBOUNDINT00

The maximum number of contributors to include in the report. The range is 1 to 100. If you omit this, the default of 10 is used.

it_metrics TYPE /AWS1/CL_CWTINSIGHTRLMETRICL00=>TT_INSIGHTRULEMETRICLIST TT_INSIGHTRULEMETRICLIST

Specifies which metrics to use for aggregation of contributor values for the report. You can specify one or more of the following metrics:

  • UniqueContributors -- the number of unique contributors for each data point.

  • MaxContributorValue -- the value of the top contributor for each data point. The identity of the contributor might change for each data point in the graph.

    If this rule aggregates by COUNT, the top contributor for each data point is the contributor with the most occurrences in that period. If the rule aggregates by SUM, the top contributor is the contributor with the highest sum in the log field specified by the rule's Value, during that period.

  • SampleCount -- the number of data points matched by the rule.

  • Sum -- the sum of the values from all contributors during the time period represented by that data point.

  • Minimum -- the minimum value from a single observation during the time period represented by that data point.

  • Maximum -- the maximum value from a single observation during the time period represented by that data point.

  • Average -- the average value from all contributors during the time period represented by that data point.

iv_orderby TYPE /AWS1/CWTINSIGHTRULEORDERBY /AWS1/CWTINSIGHTRULEORDERBY

Determines what statistic to use to rank the contributors. Valid values are Sum and Maximum.

RETURNING

oo_output TYPE REF TO /aws1/cl_cwtgetinsightrlrptout /AWS1/CL_CWTGETINSIGHTRLRPTOUT

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->/aws1/if_cwt~getinsightrulereport(
  it_metrics = VALUE /aws1/cl_cwtinsightrlmetricl00=>tt_insightrulemetriclist(
    ( new /aws1/cl_cwtinsightrlmetricl00( |string| ) )
  )
  iv_endtime = '20150101000000.0000000'
  iv_maxcontributorcount = 123
  iv_orderby = |string|
  iv_period = 123
  iv_rulename = |string|
  iv_starttime = '20150101000000.0000000'
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  LOOP AT lo_result->get_keylabels( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_insightrulecontributork = lo_row_1->get_value( ).
    ENDIF.
  ENDLOOP.
  lv_insightruleaggregations = lo_result->get_aggregationstatistic( ).
  lv_insightruleunbounddoubl = lo_result->get_aggregatevalue( ).
  lv_insightruleunboundlong = lo_result->get_approximateuniquecount( ).
  LOOP AT lo_result->get_contributors( ) into lo_row_2.
    lo_row_3 = lo_row_2.
    IF lo_row_3 IS NOT INITIAL.
      LOOP AT lo_row_3->get_keys( ) into lo_row_4.
        lo_row_5 = lo_row_4.
        IF lo_row_5 IS NOT INITIAL.
          lv_insightrulecontributork_1 = lo_row_5->get_value( ).
        ENDIF.
      ENDLOOP.
      lv_insightruleunbounddoubl = lo_row_3->get_approxaggregatevalue( ).
      LOOP AT lo_row_3->get_datapoints( ) into lo_row_6.
        lo_row_7 = lo_row_6.
        IF lo_row_7 IS NOT INITIAL.
          lv_timestamp = lo_row_7->get_timestamp( ).
          lv_insightruleunbounddoubl = lo_row_7->get_approximatevalue( ).
        ENDIF.
      ENDLOOP.
    ENDIF.
  ENDLOOP.
  LOOP AT lo_result->get_metricdatapoints( ) into lo_row_8.
    lo_row_9 = lo_row_8.
    IF lo_row_9 IS NOT INITIAL.
      lv_timestamp = lo_row_9->get_timestamp( ).
      lv_insightruleunbounddoubl = lo_row_9->get_uniquecontributors( ).
      lv_insightruleunbounddoubl = lo_row_9->get_maxcontributorvalue( ).
      lv_insightruleunbounddoubl = lo_row_9->get_samplecount( ).
      lv_insightruleunbounddoubl = lo_row_9->get_average( ).
      lv_insightruleunbounddoubl = lo_row_9->get_sum( ).
      lv_insightruleunbounddoubl = lo_row_9->get_minimum( ).
      lv_insightruleunbounddoubl = lo_row_9->get_maximum( ).
    ENDIF.
  ENDLOOP.
ENDIF.