Skip to content

update_log_pattern

update_log_pattern(
    resource_group_name: ResourceGroupName,
    pattern_set_name: LogPatternSetName,
    pattern_name: LogPatternName,
    *,
    config_overrides: Optional[ApplicationInsightsClientConfig] = None,
    pattern: Optional[LogPatternRegex] = None,
    rank: Optional[LogPatternRank] = None,
) -> UpdateLogPatternResponse

Adds a 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 (Optional[LogPatternRegex], default: None ) –

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

  • rank (Optional[LogPatternRank], default: None ) –

    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/application_insights.py
def update_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",
    *,
    config_overrides: Optional[ApplicationInsightsClientConfig] = None,
    pattern: Optional[
        "capo_application_insights.types.log_pattern_regex.LogPatternRegex"
    ] = None,
    rank: Optional[
        "capo_application_insights.types.log_pattern_rank.LogPatternRank"
    ] = None,
) -> "capo_application_insights.types.update_log_pattern_response.UpdateLogPatternResponse":
    """<p>Adds a 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.
    """

    def _handler(
        req: "OperationRequest[capo_application_insights.types.update_log_pattern_request.UpdateLogPatternRequest]",
    ) -> OperationResponse[
        "capo_application_insights.types.update_log_pattern_response.UpdateLogPatternResponse"
    ]:
        import capo_application_insights._operations.ec2_windows_barley_service.update_log_pattern

        output, http_response = (
            capo_application_insights._operations.ec2_windows_barley_service.update_log_pattern.update_log_pattern(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateLogPattern")
    )
    input_: capo_application_insights.types.update_log_pattern_request.UpdateLogPatternRequest = {
        "resource_group_name": resource_group_name,
        "pattern_set_name": pattern_set_name,
        "pattern_name": pattern_name,
    }
    if pattern is not None:
        input_["pattern"] = pattern
    if rank is not None:
        input_["rank"] = rank

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output