Skip to content

create_log_pattern async

create_log_pattern(
    resource_group_name: ResourceGroupName,
    pattern_set_name: LogPatternSetName,
    pattern_name: LogPatternName,
    pattern: LogPatternRegex,
    rank: LogPatternRank,
    *,
    config_overrides: Optional[AsyncApplicationInsightsClientConfig] = None,
) -> CreateLogPatternResponse

Adds an log pattern to a LogPatternSet.

Parameters:

  • resource_group_name (ResourceGroupName) –

    The name of the resource group.

  • pattern_set_name (LogPatternSetName) –

    The name of the log pattern set.

  • pattern_name (LogPatternName) –

    The name of the log pattern.

  • pattern (LogPatternRegex) –

    The log pattern. The pattern must be DFA compatible. Patterns that utilize forward lookahead or backreference constructions are not supported.

  • rank (LogPatternRank) –

    Rank of the log pattern. Must be a value between 1 and 1,000,000. The patterns are sorted by rank, so we recommend that you set your highest priority patterns with the lowest rank. A pattern of rank 1 will be the first to get matched to a log line. A pattern of rank 1,000,000 will be last to get matched. When you configure custom log patterns from the console, a Low severity pattern translates to a 750,000 rank. A Medium severity pattern translates to a 500,000 rank. And a High severity pattern translates to a 250,000 rank. Rank values less than 1 or greater than 1,000,000 are reserved for Amazon Web Services provided patterns.

Raises:

Source code in docs_src/capo_application_insights/_services/async_application_insights.py
async def create_log_pattern(
    self,
    resource_group_name: "capo_application_insights.types.resource_group_name.ResourceGroupName",
    pattern_set_name: "capo_application_insights.types.log_pattern_set_name.LogPatternSetName",
    pattern_name: "capo_application_insights.types.log_pattern_name.LogPatternName",
    pattern: "capo_application_insights.types.log_pattern_regex.LogPatternRegex",
    rank: "capo_application_insights.types.log_pattern_rank.LogPatternRank",
    *,
    config_overrides: Optional[AsyncApplicationInsightsClientConfig] = None,
) -> "capo_application_insights.types.create_log_pattern_response.CreateLogPatternResponse":
    """<p>Adds an log pattern to a <code>LogPatternSet</code>.</p>

    Args:
        resource_group_name: <p>The name of the resource group.</p>
        pattern_set_name: <p>The name of the log pattern set.</p>
        pattern_name: <p>The name of the log pattern.</p>
        pattern: <p>The log pattern. The pattern must be DFA compatible. Patterns that utilize forward lookahead or backreference constructions are not supported.</p>
        rank: <p>Rank of the log pattern. Must be a value between <code>1</code> and <code>1,000,000</code>. The patterns are sorted by rank, so we recommend that you set your highest priority patterns with the lowest rank. A pattern of rank <code>1</code> will be the first to get matched to a log line. A pattern of rank <code>1,000,000</code> will be last to get matched. When you configure custom log patterns from the console, a <code>Low</code> severity pattern translates to a <code>750,000</code> rank. A <code>Medium</code> severity pattern translates to a <code>500,000</code> rank. And a <code>High</code> severity pattern translates to a <code>250,000</code> rank. Rank values less than <code>1</code> or greater than <code>1,000,000</code> are reserved for Amazon Web Services provided patterns. </p>

    Raises:
        capo_application_insights.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
        capo_application_insights.errors.resource_in_use_exception.ResourceInUseException: <p>The resource is already created or in use.</p>
        capo_application_insights.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource does not exist in the customer account.</p>
        capo_application_insights.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
        capo_application_insights.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_application_insights.types.create_log_pattern_request.CreateLogPatternRequest]",
    ) -> AsyncOperationResponse[
        "capo_application_insights.types.create_log_pattern_response.CreateLogPatternResponse"
    ]:
        import capo_application_insights._operations.ec2_windows_barley_service.create_log_pattern

        (
            output,
            http_response,
        ) = await capo_application_insights._operations.ec2_windows_barley_service.create_log_pattern.async_create_log_pattern(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateLogPattern")
    )
    input_: capo_application_insights.types.create_log_pattern_request.CreateLogPatternRequest = {
        "resource_group_name": resource_group_name,
        "pattern_set_name": pattern_set_name,
        "pattern_name": pattern_name,
        "pattern": pattern,
        "rank": rank,
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output