Cleaning Service Flow Logs

Procedure

  1. Import the service flow cleaning interface from MindCluster Ascend FaultDiag.
    from ascend_fd import parse_fault_type
  2. Clean service flow logs.
    results, err_msg_list = parse_fault_type(input_log_list)

The input_log_list input format is as follows, which is for reference only. You need to modify the input information about the service flow as required.

[
    {
        "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 parameters

Field

Parameter Type

Required (Yes/No)

Description

log_domain

Dictionary

Yes

Log domain

server

String

Yes

Server IP address

device

List

Yes

Full information about the device that has been faulty

log_items

List

Yes

Log item

item_type

String

Yes

Log type

log_lines

List

Yes

Log line to be parsed

Table 2 err_msg_list parameters

Field

Parameter Type

Description

Error message

List

Error message 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 timed out.",
            "description": "The waiting time exceeds the specified latency.",
            "suggestion": [
                "1. Contact Huawei technical support."
            ]
        },
        "device_list": [
            {
                "server": "172.0.0.1",
                "device": [
                    "0", "1", "2"
                ]
            }
        ]
    }
]
Table 3 results parameters

Field

Parameter Type

Description

error_type

String

Fault code

fault_domain

String

Fault domain

attribute

Dictionary

Fault attribute

key_info

String

Key logs

component

String

Faulty component

cause

String

Failure cause

description

String

Fault description

suggestion

String

Suggestion

device_list

List

List of devices where the fault occurs

server

String

Server IP address

device

List

Device information