Cleaning Service Flow Logs

Procedure

  1. Import the service flow cleaning interface from the MindCluster Ascend FaultDiag component.

    from ascend_fd import parse_fault_type
  2. Clean the service flow logs.

    results, err_msg_list = parse_fault_type(input_log_list)

The input format of input_log_list is as follows. This example cannot be used directly. Users need to modify the relevant information of the service flow input based on the actual situation.

[
    {
        "log_domain": {
            "server": "10.1.1.1",
            "device": ["0", "1"]
        },
        "log_items": [
            {
                "item_type": "MindIE",
                "log_lines": [
                    "[ERROR] xxx",
                    "[ERROR] yyy"
                ]
            }
        ]
    },
 ...
]

Table 1 input_log_list parameter description

ParameterTypeMandatoryDescription
log_domainDictionaryYesLog domain.
serverStringYesServer address.
deviceListYesInformation about all faulty cards.
log_itemsListYesLog items.
item_typeStringYesLog type.
log_linesListYesLog lines to be parsed.

Table 2 err_msg_list parameter description

ParameterTypeDescription
Error informationListError information generated during interface execution.

The following is an example of the results output format.

[
    {
        "error_type": "AISW_MindIE_MS_HttpServer_01",
        "fault_domain": "Software",
        "attribute": {
        "key_info": "",
            "component": "MindIE",
            "module": "MS",
            "cause": "Httpserver Communication Timeout",
            "description": "The waiting time exceeds the configured delay.",
            "suggestion": [
                "1. Contact Huawei engineers for handling."
            ]
        },
        "device_list": [
            {
                "server": "172.0.0.1",
                "device": [
                    "0", "1", "2"
                ]
            }
        ]
    }
]

Table 3 Description of results parameters

FieldTypeDescription
error_typeStringFault code.
fault_domainStringFault domain.
attributeDictionaryFault attributes.
key_infoStringKey logs.
componentStringFaulty component.
causeStringFault cause.
descriptionStringFault description.
suggestionStringSuggested solution.
device_listListList of devices where this fault occurs.
serverStringServer address.
deviceListDevice information.