Error log alarm method and device, equipment and storage medium

By analyzing the error logs in the Elasticsearch cluster and combining the configuration table, a classified alarm for the error log is realized, which solves the problem of the inability to refine the error type alarm in the existing technology, and improves the stability and alarm accuracy of the system.

CN119311544APending Publication Date: 2025-01-14SHENZHEN DADAO CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411432217.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-14
Publication Date
2025-01-14

AI Technical Summary

Technical Problem

The prior art cannot effectively classify the error log. It mainly calls the alarm by querying whether the log contains the ERROR keyword or the number of ERROR keywords that appear within the specified time range, and cannot further refine the error type alarm.

Method used

By reading the error log in the Elasticsearch cluster, parsing out the microservice name, source code class name and exception type, and filtering and determining whether to send alarm information based on the preset ignorant error log configuration table and error log alarm threshold configuration table. Implement classified alarms for error logs.

Benefits of technology

It realizes detailed classified alarms for error logs, reduces unnecessary alarm information, improves the stability and maintainability of the system, and can filter and alert according to the microservice name, source code class name and exception type.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119311544A_ABST
    Figure CN119311544A_ABST
Patent Text Reader

Abstract

The invention relates to the field of computers, and discloses an error log warning method and device, equipment and a storage medium. The method comprises the following steps: reading an error log in an elastsearch cluster, and analyzing a micro-service name, a source code class name and an exception exception type from the error log; according to a preset neglect error log configuration table, screening the micro-service name, the source code class name and the exception exception type; writing the screened micro-service name, the source code class name and the exception exception type into an error log table of a database; and reading a preset error log alarm threshold value configuration table, and judging whether to send alarm information to the user terminal or not according to the error log alarm threshold value configuration table and the error log table. According to the embodiment of the invention, classified alarm of error logs can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computers, and in particular to an error log alarm method, device, equipment and storage medium. Background Art

[0002] The log records the system's operation process and exception information, such as warning logs, error logs, panic error logs in the Go language, java.lang.StackOverflowError error logs in the Java language, system operation status (such as payment failure) logs, etc.

[0003] Log keyword retrieval and monitoring alarms are common requirements in system operation. Problems can be quickly detected and located by retrieving keywords in logs and setting alarms. However, existing alarms are mainly based on whether the ERROR keyword is contained in the logs, or how many logs with the ERROR keyword appear within a specified time range, and cannot further classify error logs for alarms. Summary of the invention

[0004] The main purpose of the present invention is to solve the technical problem of how to classify and warn error logs.

[0005] A first aspect of the present invention provides an error log alarm method, the error log alarm method comprising:

[0006] Read the error log in the elasticsearch cluster and parse the microservice name, source code class name and exception type from the error log;

[0007] According to a preset ignore error log configuration table, the microservice name, the source code class name and the exception type are screened, and the ignore error log configuration table is used to record the error types that need to be ignored;

[0008] Write the filtered microservice name, source code class name and exception type into the error log table of the database;

[0009] Read the preset error log alarm threshold configuration table, and determine whether to send alarm information to the user terminal according to the error log alarm threshold configuration table and the error log table, wherein the error log alarm threshold configuration table is used to record the alarm threshold of each error type.

[0010] Optionally, in a first implementation of the first aspect of the present invention, reading the error log in the elasticsearch cluster and parsing the microservice name, source code class name and exception type from the error log includes:

[0011] Read the error log in the elasticsearch cluster;

[0012] Match the Exception keyword that appears last in each line of the error log through regular matching;

[0013] According to the Exception keyword, all exception types are obtained;

[0014] The microservice name and source code class name are parsed from the error log.

[0015] Optionally, in a second implementation of the first aspect of the present invention, parsing the microservice name and the source code class name from the error log includes:

[0016] According to the error log, obtain the corresponding elasticsearch index;

[0017] According to the fields of the elasticsearch index, the microservice name and source code class name are obtained;

[0018] Each of the exception types is combined with the microservice name and the source code class name to obtain multiple error types.

[0019] Optionally, in a third implementation of the first aspect of the present invention, before obtaining the corresponding elasticsearch index according to the error log, the method further includes:

[0020] Define the field name and corresponding type in the elasticsearch index mapping, where the field name includes the microservice name and source code class name;

[0021] Set the field attributes corresponding to the microservice name and the source code class name;

[0022] According to the field attributes, data corresponding to the microservice name and the source code class name are inserted.

[0023] Optionally, in a fourth implementation manner of the first aspect of the present invention, the reading a preset error log alarm threshold configuration table, and determining whether to send an alarm message to a user terminal according to the error log alarm threshold configuration table and the error log table includes:

[0024] Read the preset error log alarm threshold configuration table, and obtain the alarm threshold corresponding to each error type according to the error log alarm threshold configuration table;

[0025] According to the error log table, count the number of times each error type occurs within a preset time;

[0026] Determine whether the number of occurrences of each error type exceeds the alarm threshold corresponding to each error type;

[0027] If so, the corresponding alarm information is sent to the user terminal.

[0028] Optionally, in a fifth implementation of the first aspect of the present invention, the filtering of the microservice name, the source code class name, and the exception type according to a preset ignore error log configuration table includes:

[0029] Determine whether the microservice name, the source code class name, and the exception type exist in the preset ignore error log configuration table;

[0030] If so, the microservice name, the source code class name and the exception type are screened to filter out the microservice name, the source code class name and the exception type that are the same as those in the ignore error log configuration table.

[0031] Optionally, in a sixth implementation of the first aspect of the present invention, after parsing the microservice name, source code class name and exception type from the error log, the method further includes:

[0032] Parsing the error log time from the error log;

[0033] Create a time series chart to show the time distribution of error logs of different microservices.

[0034] A second aspect of the present invention provides an error log alarm device, comprising: a memory and at least one processor, wherein instructions are stored in the memory, and the memory and the at least one processor are interconnected via lines; the at least one processor calls the instructions in the memory so that the error log alarm device executes the above-mentioned error log alarm method.

[0035] A third aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the above-mentioned error log alarm method.

[0036] In an embodiment of the present invention, the error log in the elasticsearch cluster is read, and the microservice name, source code class name and exception type are parsed from the error log; the microservice name, source code class name and exception type are screened according to the preset ignore error log configuration table, and the ignore error log configuration table is used to record the error type that needs to be ignored; the screened microservice name, source code class name and exception type are written into the error log table of the database; the preset error log alarm threshold configuration table is read, and according to the error log alarm threshold configuration table and the error log table, it is determined whether to send an alarm message to the user terminal, and the error log alarm threshold configuration table is used to record the alarm threshold of each error type. In the present invention, different error types can be obtained according to the microservice name, source code class name and exception type. At the same time, by ignoring the error log configuration table, the microservice name, source code class name and exception type are screened to filter the error type, and by the error log alarm threshold configuration table, it is determined whether to alarm for the error type, thereby realizing the classification alarm of the error log. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 A schematic diagram of an embodiment of an error log alarm method in an embodiment of the present invention;

[0038] Figure 2 A schematic diagram of an embodiment of an error log alarm device in an embodiment of the present invention;

[0039] Figure 3 The figure is a schematic diagram of an embodiment of an error log alarm device in an embodiment of the present invention. DETAILED DESCRIPTION

[0040] The embodiments of the present invention provide an error log alarm method, device, equipment and storage medium.

[0041] The embodiments disclosed in the present invention will be described in more detail below with reference to the accompanying drawings. Although certain embodiments disclosed in the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments disclosed in the present invention are only for exemplary purposes and are not intended to limit the scope of protection disclosed in the present invention.

[0042] In the description of the embodiments disclosed in the present invention, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may also be included below.

[0043] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 , an embodiment of the error log alarm method in the embodiment of the present invention includes:

[0044] S100, read the error log in the elasticsearch cluster, and parse the microservice name, source code class name and exception type from the error log.

[0045] In this embodiment, elasticsearch is a distributed, RESTful-style search and data analysis engine, which is mainly used to process big data (large-scale data). It can quickly store, search and analyze data in near real time. The elasticsearch cluster is composed of one or more nodes, which jointly hold data and provide indexing and search functions. When the amount of data and queries grows, the load should be distributed among multiple nodes to improve processing capacity and reliability.

[0046] First, read the error log of the Java application stored in the elasticserach cluster regularly. Specifically, log in to the Elasticsearch Service console first. In the console, find and click the cluster ID or name of the log you want to view to view the running log of the target cluster. Then, in the log page, you can filter out the log content you need to query by entering keywords and setting the time range. In particular, you can quickly locate the error log by setting the log level to "ERROR". After reading the error log, you can use the log collection tool Filebeat or Logstash to read the data in the error log and parse it to get the microservice name, source code class name and exception type. Among them, the microservice name is used to indicate the identifier of the microservice where the problem is located; the source code class name is used to indicate the name of the specific source code file of the problem; the exception type is used to indicate the specific exception type of the problem. Through the microservice name, source code class name and exception type, the location and type of the problem can be located, so as to further analyze and solve the problem.

[0047] S200, according to the preset ignore error log configuration table, the microservice name, source code class name and exception type are screened.

[0048] In this embodiment, an ignore error log configuration table is set in the database, wherein the database can be a MySQL database; the ignore error log configuration table records the error types that need to be ignored, and the ignore error log configuration table mainly includes three fields, including microservice name, source code class name and exception type. Through the three fields of microservice name, source code class name and exception type, it can be confirmed whether it is the same error type. Then, through the ignore error log configuration table, the microservice name, source code class name and exception type are screened, and the error types that need to be ignored are filtered out, so that these ignored error types will not send corresponding alarm information. For example, during system maintenance or upgrade, some expected error logs may be generated. These logs usually do not need to be processed immediately because they are part of normal operation. For example, after installing updates or configuration changes, the system may record some temporary error information. These error information can be recorded in the ignore error log configuration table so that it does not send corresponding alarm information, so as to reduce unnecessary alarm information and improve the stability and maintainability of the system.

[0049] S300, write the filtered microservice name, source code class name and exception type into the error log table of the database.

[0050] In this embodiment, an error log table is created in the database to store error information. The table structure includes microservice name, source code class name and exception type fields. After screening, the data information corresponding to the microservice name, source code class name and exception type is written into the error log table of the database, wherein SQL statements can be used to insert data into the error log table. Optionally, data can be written into the error log table of the database in an asynchronous manner, that is, after each microservice name, source code class name and exception type are screened, they are immediately written into the error log table of the database. The screening and writing of the microservice name, source code class name and exception type are performed simultaneously to improve the efficiency of data processing. Specifically, a class can be defined, and an asynchronous task that implements the Callable interface can be written to write the microservice name, source code class name and exception type into the database.

[0051] S400, reading a preset error log alarm threshold configuration table, and judging whether to send alarm information to a user terminal according to the error log alarm threshold configuration table and the error log table.

[0052] In this embodiment, an error log alarm threshold configuration table is set in the database, wherein the error log alarm threshold configuration table records the alarm threshold of each error type, and specifies how many times an alarm occurs within a specified time range, for example, an alarm message is sent when a certain error type occurs 10 times in 5 minutes. According to the alarm threshold, the error log table of the database is queried to see whether there is a matching error type, and if so, an alarm message is sent to the user terminal, wherein a certain error type can be determined according to the microservice name, source code class name, and exception type, and the alarm message can be sent through multiple methods such as email, SMS, and mobile phone applications, and the specific sending method can be selected according to the actual situation.

[0053] In an optional implementation of the first aspect of the present invention, reading the error log in the elasticsearch cluster, and parsing the microservice name, source code class name and exception type from the error log include:

[0054] Read the error log in the elasticsearch cluster; match the Exception keyword that appears at the end of each line in the error log through regular matching; get all exception types based on the Exception keyword; parse the microservice name and source code class name from the error log.

[0055] In this embodiment, in Java, an exception is an error or abnormal condition that may occur during program execution. The exception types in Java are mainly divided into two categories: checked exceptions and unchecked exceptions. Among them, checked exceptions refer to exceptions that must be handled during compilation. If they are not handled, the compiler will report an error. Such exceptions are usually caused by external factors, such as files not found, network connection failures, etc. Common checked exceptions include: IOException, SQLException, ClassNotFoundException. Unchecked exceptions refer to exceptions that are not mandatory to be handled during compilation. Such exceptions are usually caused by program logic errors, such as null pointer references, array out of bounds, etc. Unchecked exceptions are subclasses of RuntimeException. Common unchecked exceptions include: NullPointerException, ArrayIndexOutOfBoundsException, ArithmeticException.

[0056] Parse the exception type from the error log. First, match the Exception keyword that appears at the end of each line in the error log through regular matching. The exception type can be obtained based on the Exception keyword. For example, a line of data in the following error log:

[0057] [2023-04-01T12:00:00,000][ERROR][oeccCSpottedIOException]

[0058] It contains the Exception keyword, locates the Exception keyword, IOException is a checked exception, and SpottedIOException is a subclass of IOException.

[0059] Optionally, the following regular expression can be used to match the Exception keyword:

[0060] .*Exception.*

[0061] Among them, .* matches any number of any characters (including blank characters). Exception matches the string Exception. .* matches any number of any characters again.

[0062] This regular expression will match any line containing the Exception keyword, no matter where Exception appears in the line.

[0063] In an optional implementation of the first aspect of the present invention, parsing the microservice name and the source code class name from the error log includes:

[0064] According to the error log, the corresponding elasticsearch index is obtained; according to the field of the elasticsearch index, the microservice name and source code class name are obtained; each exception type is combined with the microservice name and source code class name to obtain multiple error types.

[0065] In this embodiment, elasticsearch is a distributed search and analysis engine that organizes and stores documents through indexes. Each index can contain multiple document types. A document type is a collection of documents. Documents are stored in a logical storage model defined by the index. Each index has a uniquely identifiable name and is divided into one or more shards. These shards are smaller subsets of the index and can be processed in parallel and distributedly stored in all elasticsearch node clusters, so that elasticsearch can process large-scale log data and provide efficient search capabilities. Elasticsearch organizes and stores error log data through indexes, so the corresponding elasticsearch index can be obtained through the error log, and then the fields in the elasticsearch index are queried to obtain the error log time, microservice name, and source code class name, and then each exception type is combined with the microservice name and source code class name to obtain multiple error types.

[0066] In an optional implementation of the first aspect of the present invention, before obtaining the corresponding elasticsearch index according to the error log, the method further includes:

[0067] Define the field name and corresponding type in the elasticsearch index mapping. The field name includes the microservice name and source code class name. Set the field attributes corresponding to the microservice name and source code class name. According to the field attributes, insert the data corresponding to the microservice name and source code class name.

[0068] In this embodiment, you first need to create or update the Mapping of the index in elasticsearch. The Mapping defines the type, attributes, and settings of each field in the index. Specifically, first define the field name in the elasticsearch index Mapping, including the microservice name and source code class name, and then define the field type. The microservice name and source code class name can be defined as keyword types for precise matching and aggregation. Then set the field attributes. For keyword type fields, you can set the ignore_above attribute to limit the maximum length of the field value. When inserting the data corresponding to the microservice name and source code class name, ensure that the data format is consistent with the field type defined in the Mapping.

[0069] In an optional implementation manner of the first aspect of the present invention, reading a preset error log alarm threshold configuration table, and judging whether to send alarm information to a user terminal according to the error log alarm threshold configuration table and the error log table includes:

[0070] Read the preset error log alarm threshold configuration table, and obtain the alarm threshold corresponding to each error type according to the error log alarm threshold configuration table; according to the error log table, count the number of times each error type occurs within the preset time; determine whether the number of times each error type occurs exceeds the alarm threshold corresponding to each error type; if so, send the corresponding alarm information to the user terminal.

[0071] In this embodiment, the same error type can be determined by the microservice name, source code class name and exception type. After the microservice name, source code class name and exception type are written into the error log table of the database, the number of occurrences of each error type within the preset time is counted through the error log table. Optionally, the time window can be used to count the number of occurrences of each error type. According to the error log alarm threshold configuration table, the alarm threshold corresponding to each error type is obtained, and it is determined whether the number of occurrences of the error type exceeds the corresponding alarm threshold. If it exceeds, the corresponding alarm information is sent to the user terminal. For example, within 5 minutes, a certain error type occurs 5 times, and the alarm threshold corresponding to the error type is 3 times. It can be seen that the number of occurrences of the error type exceeds the alarm threshold, and the corresponding alarm information needs to be sent for the error type. In addition, in order to avoid false alarms and repeated alarms, an alarm suppression mechanism can be set. For example, an alarm will only be triggered if the alarm condition is met in multiple consecutive checks, or the minimum interval between two notifications is set.

[0072] In an optional implementation of the first aspect of the present invention, according to a preset ignore error log configuration table, filtering the microservice name, source code class name and exception type includes:

[0073] Determine whether the microservice name, source code class name, and exception type exist in the preset ignore error log configuration table; if so, filter the microservice name, source code class name, and exception type to filter out the microservice name, source code class name, and exception type that are the same as those in the ignore error log configuration table.

[0074] In this embodiment, the parsed microservice name, source code class name and exception type are compared with the preset ignore error log configuration table to determine whether the microservice name, source code class name and exception type exist in the preset ignore error log configuration table. If so, the microservice name, source code class name and exception type that are the same as those in the ignore error log configuration table are filtered out from the parsed microservice name, source code class name and exception type. This can be achieved by adding a filter in the logging process. The filter checks whether each microservice name, source code class name and exception type exists in the ignore error log configuration table and decides whether to filter it out. The microservice name, source code class name and exception type that are not filtered out continue to be recorded in the error log table.

[0075] In an optional implementation of the first aspect of the present invention, after parsing the microservice name, source code class name and exception type from the error log, the method further includes:

[0076] Parse the error log time from the error log; create a time series chart to show the error log time distribution of different microservices.

[0077] In this embodiment, the elasticsearch index corresponding to the error log is obtained, the error log time is obtained from the elasticsearch index field, and the time series chart tool is used to display the time distribution of the error logs of different microservices. The time series chart can intuitively display the data changes over time, see the error frequency and time distribution of different microservices, and thus identify possible problem areas.

[0078] See also Figure 2 A second aspect of the present invention provides an error log alarm device, the error log alarm device comprising:

[0079] The error log parsing module 10 is used to read the error log in the elasticsearch cluster and parse the microservice name, source code class name and exception type from the error log;

[0080] The error log screening module 20 is used to screen the microservice name, source code class name and exception type according to a preset ignore error log configuration table, and the ignore error log configuration table is used to record the error types that need to be ignored;

[0081] The data writing module 30 is used to write the screened microservice name, source code class name and exception type into the error log table of the database;

[0082] The alarm judgment module 40 is used to read the preset error log alarm threshold configuration table, and judge whether to send alarm information to the user terminal according to the error log alarm threshold configuration table and the error log table. The error log alarm threshold configuration table is used to record the alarm threshold of each error type.

[0083] In an optional implementation of the second aspect of the present invention, the error log parsing module 10 is also used to read the error log in the elasticsearch cluster; match the Exception keyword that appears last in each line in the error log through regular matching; obtain all exception types based on the Exception keyword; and parse the microservice name and source code class name from the error log.

[0084] In an optional implementation of the second aspect of the present invention, the error log parsing module 10 is also used to obtain the corresponding elasticsearch index based on the error log; obtain the microservice name and source code class name based on the field of the elasticsearch index; and combine each exception type with the microservice name and source code class name to obtain multiple error types.

[0085] In an optional implementation manner of the second aspect of the present invention, the error log alarm device further includes:

[0086] The field setting module is used to define the field name and corresponding type in the elasticsearch index mapping. The field name includes the microservice name and the source code class name; set the field attributes corresponding to the microservice name and the source code class name; and insert the data corresponding to the microservice name and the source code class name according to the field attributes.

[0087] In an optional implementation of the second aspect of the present invention, the alarm judgment module 40 is also used to read a preset error log alarm threshold configuration table, and obtain the alarm threshold corresponding to each error type according to the error log alarm threshold configuration table; according to the error log table, count the number of times each error type occurs within a preset time; determine whether the number of times each error type occurs exceeds the alarm threshold corresponding to each error type; if so, send the corresponding alarm information to the user terminal.

[0088] In an optional implementation of the second aspect of the present invention, the error log filtering module 20 is also used to determine whether the microservice name, source code class name and exception type exist in the preset ignore error log configuration table; if so, the microservice name, source code class name and exception type are filtered to filter out the microservice name, source code class name and exception type that are the same as those in the ignore error log configuration table.

[0089] In an optional implementation manner of the second aspect of the present invention, the error log alarm device further includes:

[0090] The display module is used to parse the error log time from the error log; create a time series chart to display the error log time distribution of different microservices.

[0091] Figure 3 1 is a schematic diagram of the structure of an error log alarm device provided by an embodiment of the present invention. The error log alarm device 500 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 510 (for example, one or more processors) and a memory 520, and one or more storage media 530 (for example, one or more mass storage devices) storing application programs 533 or data 532. Among them, the memory 520 and the storage medium 530 can be short-term storage or permanent storage. The program stored in the storage medium 530 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the error log alarm device 500. Furthermore, the processor 510 can be configured to communicate with the storage medium 530 to execute a series of instruction operations in the storage medium 530 on the error log alarm device 500.

[0092] The error log based alarm device 500 may also include one or more power supplies 540, one or more wired or wireless network interfaces 550, one or more input and output interfaces 560, and / or one or more operating systems 531, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. It will be appreciated by those skilled in the art that Figure 3 The error log alarm device structure shown does not constitute a limitation on the error log-based alarm device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0093] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes the steps of the error log alarm method.

[0094] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0095] In addition, although each operation is described in a specific order, this should be understood as requiring such operation to be performed in the specific order shown or in a sequential order, or requiring that all illustrated operations should be performed to obtain desired results. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single implementation in combination. On the contrary, the various features described in the context of a single implementation can also be implemented in multiple implementations individually or in any suitable sub-combination mode.

[0096] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. An error log alarm method, characterized in that: The error log alarm method comprises: Read the error log in the elasticsearch cluster and parse the microservice name, source code class name and exception type from the error log; According to a preset ignore error log configuration table, the microservice name, the source code class name and the exception type are screened, and the ignore error log configuration table is used to record the error types that need to be ignored; Write the filtered microservice name, source code class name and exception type into the error log table of the database; Read the preset error log alarm threshold configuration table, and determine whether to send alarm information to the user terminal according to the error log alarm threshold configuration table and the error log table, wherein the error log alarm threshold configuration table is used to record the alarm threshold of each error type.

2. The error log alarm method according to claim 1, characterized in that: The process of reading the error log in the elasticsearch cluster and parsing the microservice name, source code class name and exception type from the error log includes: Read the error log in the elasticsearch cluster; Match the Exception keyword that appears last in each line of the error log through regular matching; According to the Exception keyword, all exception types are obtained; The microservice name and source code class name are parsed from the error log.

3. The error log alarm method according to claim 2, characterized in that: The step of parsing the microservice name and source code class name from the error log includes: According to the error log, obtain the corresponding elasticsearch index; According to the fields of the elasticsearch index, the microservice name and source code class name are obtained; Each of the exception types is combined with the microservice name and the source code class name to obtain multiple error types.

4. The error log alarm method according to claim 3, characterized in that: Before obtaining the corresponding elasticsearch index according to the error log, the method further includes: Define the field name and corresponding type in the elasticsearch index mapping, where the field name includes the microservice name and source code class name; Set the field attributes corresponding to the microservice name and the source code class name; According to the field attributes, data corresponding to the microservice name and the source code class name are inserted.

5. The error log alarm method according to claim 1, characterized in that: The reading of a preset error log alarm threshold configuration table, and judging whether to send alarm information to a user terminal according to the error log alarm threshold configuration table and the error log table, comprises: Read the preset error log alarm threshold configuration table, and obtain the alarm threshold corresponding to each error type according to the error log alarm threshold configuration table; According to the error log table, count the number of times each error type occurs within a preset time; Determine whether the number of occurrences of each error type exceeds the alarm threshold corresponding to each error type; If so, the corresponding alarm information is sent to the user terminal.

6. The error log alarm method according to claim 1, characterized in that: The filtering of the microservice name, the source code class name and the exception type according to the preset ignore error log configuration table includes: Determine whether the microservice name, the source code class name, and the exception type exist in the preset ignore error log configuration table; If so, the microservice name, the source code class name and the exception type are screened to filter out the microservice name, the source code class name and the exception type that are the same as those in the ignore error log configuration table.

7. The error log alarm method according to claim 1, characterized in that: After parsing the microservice name, source code class name and exception type from the error log, the following further includes: Parsing the error log time from the error log; Create a time series chart to show the time distribution of error logs of different microservices.

8. An error log alarm device, characterized in that: The error log alarm device comprises: The error log parsing module is used to read the error log in the elasticsearch cluster and parse the microservice name, source code class name and exception type from the error log; An error log screening module, used to screen the microservice name, the source code class name and the exception type according to a preset ignore error log configuration table, wherein the ignore error log configuration table is used to record the error types that need to be ignored; A data writing module is used to write the filtered microservice name, the source code class name and the exception type into the error log table of the database; The alarm judgment module is used to read a preset error log alarm threshold configuration table, and judge whether to send an alarm message to the user terminal according to the error log alarm threshold configuration table and the error log table. The error log alarm threshold configuration table is used to record the alarm threshold of each error type.

9. An error log alarm device, characterized in that: The error log alarm device comprises: a memory and at least one processor, the memory stores instructions, and the memory and the at least one processor are interconnected via a line; The at least one processor calls the instruction in the memory to enable the error log alarm device to execute the error log alarm method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the error log alarm method according to any one of claims 1 to 7 is implemented.