CN115757057A - Log checking method, device, equipment and storage medium - Google Patents

Log checking method, device, equipment and storage medium Download PDF

Info

Publication number
CN115757057A
CN115757057A CN202211304701.5A CN202211304701A CN115757057A CN 115757057 A CN115757057 A CN 115757057A CN 202211304701 A CN202211304701 A CN 202211304701A CN 115757057 A CN115757057 A CN 115757057A
Authority
CN
China
Prior art keywords
log data
log
point location
target
rule
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211304701.5A
Other languages
Chinese (zh)
Inventor
徐文平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202211304701.5A priority Critical patent/CN115757057A/en
Publication of CN115757057A publication Critical patent/CN115757057A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The disclosure provides a log checking method, a log checking device, log checking equipment and a storage medium, and relates to the field of computers, in particular to the field of log processing. The specific implementation scheme is as follows: acquiring at least one point location and a check rule thereof in target log data according to a log point location relation matched with the target log data to be checked, wherein the log point location relation comprises a corresponding relation between the point location in the target log data and the check rule of the point location; and verifying the target log data according to the at least one point location in the target log data and the verification rule thereof to obtain a verification result of the target log data. In the embodiment of the disclosure, the point position in the target log data and the verification rule thereof are obtained according to the log point position relationship matched with the target log data, so that the target log data is verified, and different target log data can be flexibly verified.

Description

Log verification method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technology, and more particularly, to the field of log processing.
Background
The mobile analysis function relies on the buried point log reported by the client. And reporting relevant information of the user equipment through the embedded point log, wherein the relevant information comprises various information such as public network IP (Internet Protocol) address, system version, equipment model, operating system and the like. User characteristics can be analyzed externally, and product optimization is performed in a targeted manner; and the error log information can be reported internally, so that the product quality is improved and the like.
Disclosure of Invention
The disclosure provides a log checking method, a log checking device, log checking equipment and a storage medium.
According to an aspect of the present disclosure, there is provided a log checking method, including:
acquiring at least one point location and a check rule thereof in target log data according to a log point location relation matched with the target log data to be checked, wherein the log point location relation comprises a corresponding relation between the point location in the target log data and the check rule of the point location;
and verifying the target log data according to the at least one point location in the target log data and the verification rule thereof to obtain a verification result of the target log data.
According to another aspect of the present disclosure, there is provided a log verifying apparatus including:
the acquisition module is used for acquiring at least one point location in the target log data and a verification rule thereof according to a log point location relationship matched with the target log data to be verified, wherein the log point location relationship comprises a corresponding relationship between the point location in the target log data and the verification rule of the point location;
and the verification module is used for verifying the target log data according to the at least one point location in the target log data and the verification rule thereof to obtain a verification result of the target log data.
According to another aspect of the present disclosure, there is provided an electronic device including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to cause the at least one processor to perform a method according to any one of the embodiments of the present disclosure.
According to another aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform a method according to any one of the embodiments of the present disclosure.
According to another aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements a method according to any one of the embodiments of the present disclosure.
In the embodiment of the disclosure, the point position and the verification rule thereof in the target log data are obtained according to the log point position relation matched with the target log data, so that the target log data is verified, and different target log data can be flexibly verified.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
fig. 1 is a schematic flow chart diagram of a log verification method according to an embodiment of the present disclosure.
Fig. 2 is a schematic flow chart diagram of a log checking method according to another embodiment of the present disclosure.
Fig. 3 is a schematic flow chart diagram of a log checking method according to another embodiment of the present disclosure.
Fig. 4 is a flowchart illustrating a log checking method according to another embodiment of the disclosure.
Fig. 5 is a flowchart illustrating a log checking method according to another embodiment of the disclosure.
Fig. 6 is a schematic structural diagram of a log checking apparatus according to an embodiment of the present disclosure.
Fig. 7 is a schematic structural diagram of a log checking apparatus according to another embodiment of the present disclosure.
FIG. 8 is a system architecture diagram of an exemplary log check service.
FIG. 9 is a schematic diagram of a business to rule relationship.
Fig. 10 is a block diagram of an electronic device for implementing a log checking method of an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic flow chart diagram of a log checking method according to an embodiment of the present disclosure. The log verification method may include:
s101, acquiring at least one point location and a check rule thereof in target log data according to a log point location relation matched with the target log data to be checked, wherein the log point location relation comprises a corresponding relation between the point location in the target log data and the check rule of the point location;
s102, verifying the target log data according to the at least one point location in the target log data and the verification rule thereof to obtain a verification result of the target log data.
In the embodiment of the present disclosure, the log point location relationship of the log data may be preset. The general contents of different types of log data are different, and the log point location relation can be different. The log point location relationship may include each point location in the log data and its corresponding check rule. Each bit can be automatically generated according to the content characteristics of the log data, and can also allow manual modification and supplement. The point location verification rules may be automatically set according to default verification rules, or may allow for manual modification and replenishment. For example, default verification rules may include not null, string value type is string, num value type is number, etc. The default checking rules needed to be used for different log data may be different, or may be the same or partially the same.
If the log data includes a large number of point locations, it may be equivalent to obtain a set of corresponding relationships between each point location and its corresponding check rule in the log data. The set may be used as a log point location corresponding to the log data.
In the embodiment of the disclosure, the point in the target log data and the verification rule thereof are obtained according to the log point location relationship of the target log data, so that the target log data is verified, which is beneficial to flexibly verifying different target log data. Compared with the fixed point location of the log data, the method has better verification result and expandability.
Fig. 2 is a schematic flow chart diagram of a log checking method according to another embodiment of the present disclosure. The method of this embodiment includes one or more features of the log verification method embodiments described above. In one possible embodiment, the method further comprises:
s201, searching a log point location relation matched with the target log data in the log rule relation;
the log rule relationship comprises a corresponding relationship between the type identification of the log data and the point location relationship of the log.
In the embodiment of the present disclosure, the log rule relationship may be stored in a database, for example, a rule base, in advance in a correspondence relationship between the type identifier of the log data and the point location relationship of the log. The identification of the type of log data may include one or more of an identification of an application program that generated the log data, an identification of a terminal device, an identification of a manufacturer, and the like. The type identification of the log data enables a determination of which type the log data belongs to. Different types of log data may have different log point location relationships.
In the embodiment of the disclosure, different log point location relations are set for different types of logs in the log rule relation, which is beneficial to flexibly utilizing the matched log point location relation to check the target log data.
In one possible implementation, finding a log point location relationship matching the target log data in a log rule relationship includes: and searching the log point location relation matched with the type identifier of the target log data in the log rule relation according to the type identifier of the target log data. In the embodiment of the disclosure, the log point location relation matched with the target log data can be found in the log rule relation by using the type identifier of the target log data, so that the target log data can be more accurately verified by using the matched log point location relation.
In a possible implementation manner, as shown in fig. 3, in S101, obtaining at least one point in the target log data and a verification rule thereof according to a log point location relationship matched with the target log data that needs to be verified includes:
s301, according to the log point location relation matched with the target log data, obtaining a path search expression of the at least one point location in the target log data and at least one check rule corresponding to the path search expression.
In the disclosed embodiment, the point locations of the log data may have corresponding path search expressions. For example, the point of the log data can be represented by a parsing expression JsonPath of Json (JavaScript Object Notation).
The following is an example of a piece of log data:
{
"timestamp":"1640856261606",
"id":"1929",
"type":"0",
"con":
"{\"type\":\"stability\",\"ext\":{\"name\":\"demo\",\"pass\":\"123\"}}"
}
type, con, ext, name, demo, pass, etc. in the log data may be a point of the log data. Using "pass" as an example, some analytical expression may be used to determine the point "pass". For example, json's analytical expression JsonPath is used to determine the value of the "pass" field. Specifically, the value of the "pass" field may be obtained using, for example, the expression $. Con + $. Ext. The "+" sign in this expression may indicate that the value of the "pass" field in "ext" in "con" is obtained. The json path of each point of the log data can be automatically generated.
In addition, a check rule for a "pass" may include a check rule that is not null, e.g., pass! = empty, may also include specific values such as a pass value in (1, 2,3, 4), may also include boolean values such as a pass value is borolean, etc. Specifically, one or more check rules may be set for the "pass" according to the requirement.
Illustratively, if the check rule of a field is not null, the check is successful if the value of the field is not null, and the check is failed if the value of the field is null. If the check rule of a field is a specific value (1, 2,3, 4), the check is successful if the value of the field is 1,2,3 or 4, and the value of the field is not 1,2,3 or 4, for example, if the value of the "pass" field is 5, the check fails. If the check rule of a certain field is a boolean value "True", the check is successful if the value of the field is "True", and the check fails if the value of the field is not "True".
In the embodiment of the disclosure, by using the path search expression corresponding to the point location of the log data, the target log data can be quickly searched, and the speed and accuracy of searching the point location content are improved, so that the verification speed and accuracy are improved.
In one possible implementation, the log rule relationship includes a first key-value pair stored in a rule base, a key of the first key-value pair is a type identifier of the log data, and a value of the first key-value pair is a log point location relationship of the log data.
In one possible implementation, the log point location relationship includes a second key-value pair stored in the values of the first key-value pair of the rule base, the key of the second key-value pair being a path search expression of the point location of the log data, and the value of the second key-value pair being at least one check rule of the point location of the log data.
In the embodiment of the present disclosure, the log rule relationship and the log point location relationship may be saved in a database, for example, a rule base, in a manner of value pairs. Under the condition that log verification is needed, the log point location relation matched with the target log data can be quickly found by utilizing the first key value pair. The log point location relationship may include a plurality of second key value pairs, and the content and the check rule of each point location in the target log data are quickly found in the log point location relationship matched with the target log data. And then verifying the content of the point location by utilizing the verification rule of the point location in the target log data.
In one possible embodiment, as shown in fig. 4, the method further comprises:
s401, performing path search on the reference log data, and extracting a path search expression of a point location from the reference log data;
s402, setting at least one check rule for the point position of the reference log data;
s403, storing at least one check rule of the point location in a path search expression of the point location of the reference log data as a second key value pair, wherein all the second key value pairs of the reference log data form a log point location relation of the reference log data;
s404, saving the type identification of the reference log data and the log point location relation of the reference log data as a first key value pair.
In the embodiments of the present disclosure, the reference log data may also be referred to as a log sample (schema). One type of reference log data may generate a log rule relationship and a log point location relationship for the log data. The log data of the same type can be verified by using the same log rule relationship and log point location relationship. The log rule relation is stored in a first key value pair mode, the log point position relation is stored in a second key value pair mode, searching is convenient, the log type and the log verification rule can be flexibly expanded, the quality of log embedded points can be improved, and the accuracy of verification results can be improved.
In a possible implementation manner, as shown in fig. 3, in S102, verifying the target log data according to the at least one point in the target log data and the verification rule thereof to obtain a verification result of the target log data, includes:
s302, searching to obtain a target field needing to be verified in the target log data by utilizing a path retrieval expression of a target point position in the log point position relation of the target log data;
and S303, verifying the target field by using the verification rule corresponding to the path retrieval expression of the target point to obtain a verification result of the target field.
In the embodiment of the present disclosure, if the type identifier of the target log data is the same as the type identifier of some reference log data, the log rule relationship and the log point location relationship generated by the reference log data may be used for verification. For example, a JsonPath expression is extracted from a key of a second key-value pair of the log point location relation of the target log data, and the JsonPath expression is used for quickly searching in the target log data to obtain a target field needing to be checked. The target field is then verified using the verification rule in the value of the second key-value pair. Target fields can be quickly searched in target log data through the path retrieval expression, and the verification speed is improved.
In one possible embodiment, as shown in fig. 5, the method further comprises:
s501, counting the verification result of the target log data to obtain a problem item and/or a service item of the target log data;
wherein the problem item comprises at least one of a newly added problem, a known problem and a repaired problem obtained by checking the target log data;
the service item comprises a check failure rate and/or a check success rate corresponding to the service index.
In the embodiment of the present disclosure, after the target log data is checked, a problem item indicating that the checking result fails in the target log data may be obtained, for example, a data format error, a data content being empty, a value range error, and the like. In addition, the check rules of different services can be classified. For example, the first-level check rule is a business index, the second-level check rule is a business rule, and the third-level check rule is a rule detail. In the point location relationship of the log, different service rules under the same service index can be stored in an associated manner, and different service details of the same service rule can be stored in an associated manner. When the verification result is generated, statistics can be respectively carried out aiming at different service indexes to obtain the verification result of the service item.
In the embodiment of the disclosure, by counting log verification results, problems existing in target log data can be obtained, and analysis can be performed from the perspective of business indexes, so that the problems can be solved or repaired in time.
In one possible embodiment, as shown in fig. 5, the method further comprises:
s502, tracking a verification result of the target log data;
s503, the verification result of the target log data in the target time interval is synchronized at regular time.
In the embodiment of the present disclosure, by tracking the check result, for example, tracking the problem item and/or the service item, the items that need to be further processed, such as the problem item and/or the service item, can be synchronized to the processing end that is in communication with the problem item and/or the service item in time, so that the problem can be solved or repaired in time at the processing end. In this way, a complete problem discovery, tracking, repair, regression verification closed loop path may be implemented.
Fig. 6 is a schematic structural diagram of a log checking apparatus according to an embodiment of the present disclosure. The log verifying apparatus may include:
an obtaining module 601, configured to obtain at least one point location in target log data and a check rule thereof according to a log point location relationship matched with the target log data to be checked, where the log point location relationship includes a correspondence relationship between a point location in the target log data and the check rule of the point location;
the verifying module 602 is configured to verify the target log data according to the at least one point location in the target log data and a verifying rule thereof, so as to obtain a verifying result of the target log data.
In a possible embodiment, as shown in fig. 7, the apparatus further comprises:
a searching module 701, configured to search a log point location relationship matching the target log data in a log rule relationship;
the log rule relationship comprises a corresponding relationship between the type identification of the log data and the log point location relationship.
In a possible implementation manner, the search module is configured to search, according to the type identifier of the target log data, a log point location relationship matching the type identifier of the target log data in the log rule relationship.
In a possible implementation manner, the obtaining module is configured to obtain, according to a log point location relationship matched with the target log data, a path search expression of the at least one point location in the target log data and at least one check rule corresponding to the path search expression.
In one possible implementation, the log rule relationship includes a first key-value pair stored in a rule base, a key of the first key-value pair is a type identifier of the log data, and a value of the first key-value pair is a log point location relationship of the log data.
In one possible implementation, the log point location relationship includes a second key-value pair stored in the values of the first key-value pair of the rule base, the key of the second key-value pair being a path search expression of the point location of the log data, and the value of the second key-value pair being at least one check rule of the point location of the log data.
In one possible embodiment, the apparatus further comprises:
a path search module 702, configured to perform path search on the reference log data, and extract a path search expression of a point location from the reference log data;
a rule setting module 703, configured to set at least one check rule for the point location of the reference log data;
a first saving module 704, configured to save at least one check rule of the point location in the path search expression of the point location of the reference log data as a second key-value pair, where all second key-value pairs of the reference log data form a log point location relationship of the reference log data;
the second saving module 705 is configured to save the type identifier of the reference log data and the log point location relationship of the reference log data as a first key-value pair.
In a possible implementation manner, the verification module is configured to search for a target field to be verified in the target log data by using a path retrieval expression of a target point location in a log point location relationship of the target log data; and verifying the target field by using the verification rule corresponding to the path retrieval expression of the target point position to obtain a verification result of the target field.
In one possible embodiment, the apparatus further comprises:
a statistic module 706, configured to perform statistics on the check result of the target log data to obtain a problem item and/or a service item of the target log data;
wherein the problem item comprises at least one of a newly added problem, a known problem and a repaired problem obtained by checking the target log data;
the service item comprises a check failure rate and/or a check success rate corresponding to the service index.
In one possible embodiment, the apparatus further comprises:
a tracking module 707, configured to track a check result of the target log data;
a synchronization module 708, configured to synchronize the verification result of the target log data in the target time period at regular time.
For a description of specific functions and examples of each module and sub-module of the apparatus in the embodiment of the present disclosure, reference may be made to the description of corresponding steps in the foregoing method embodiments, and details are not repeated here.
In one example, the log content finally reported by the log point is analyzed, and whether each field reported by the log point location meets expectations or not can be determined. Therefore, the higher the quality of the log buried point is, the higher the accuracy of the analysis effect can be ensured. However, the common reporting log of the buried point may have the following characteristics but is not limited to the following characteristics: event repetition or loss; parameter errors, loss of necessary transmission items of the parameters, incapability of meeting expectations of parameter value types and incapability of meeting expectations of value ranges; front-end common code problems cause the uploaded items to be unexpected, such as "unformed" and the like.
At the beginning of the product design that can generate log data, the basic format of the point of engagement includes the common reference field name, type, and its location in the overall log point. During final verification, only the appointed known position needs to be verified, and rules are set for judgment. For example, if a service field is to be checked, a specific location field may be fetched to retrieve data. The mapping relation between the position of the field and the service expression meaning is bound in a man-made constraint mode, so that the subsequent expansion is not facilitated, and the quick and complex iterative relation of the product is faced. Therefore, the supported check types are limited, and generally, only basic judgment is performed on the basic type and the value range of the field, and whether the field is empty or not. When the service is complex, the expansion of the check type cannot be properly performed.
The log verification method provided by the embodiment of the disclosure is a method for positioning a verification field by virtue of Jsonpath, the position of the field is described by virtue of Jsonpath, and a self-defined verification rule is provided, so that a verification result can be obtained quickly. After the check result is obtained, the service item statistical result and the problem item statistical result of the obtained result can be analyzed, the PM end pays attention to the service line statistical result, and the RD end and the QA end pay attention to the problem item result, and the original reported log is checked, so that the whole closed-loop logic of exposure, recording, tracking and repairing of the problem item is realized.
The log verification process in the embodiment of the application is as follows:
1. and (5) self-defining the rule.
For example, the system expects to get a complete log sample (schema) of the point, and quickly search the log data by jsonnpath, resulting in the fields expected to be checked. As shown in fig. 8, a point location management module may include a point location management table. The log center can generate a custom rule by using the sample, thereby providing rich verification rules. The check rules may be stored in a rule base in a Key-value pair, such as Map < Key, list < rule >. Examples of specific rules include, but are not limited to, the following table 1:
TABLE 1
Encoding Type of check Value enumeration
array The value type being a Json array
bool The value type is a bolean type true or false
contain Check object contains value value
enum Value type enumeration value checking List of enumeration values
equal Assigned value value
num The value type is a number, including integer and floating point numbers
object The value type is a Json object
required Whether or not a field must be transmitted
string The value type being a string
2. Filtering of fishing logs
As shown in fig. 8, different streams are obtained to obtain log data of different real-time stream links (data sources may include various message middleware such as Kafka and bigpie), and offline stream links (data sources may include HDFS (Hadoop Distributed File System, etc.), and the log data are injected into the check service module. The verification service module obtains a rule list or a rule chain such as rule 1 \8230; rule N, which needs to be verified, of the point location field from the point location management module through a previously customized rule base and a rule matcher. And the rule matcher verifies the point positions of the log by using the rules so as to obtain a verification result. The verification results may be saved to a results repository.
3. Statistics of check results
The service expects many types of analysis to be performed on the verification results, examples of which are as follows:
(1) Question item
And aiming at problem item restoration of a verification result, the content verification service regularly outputs a data verification result, newly-added problems, known problems, restored problems and the like are distinguished, the QA end carries out problem follow-up sorting, workers on the pushing end carry out problem restoration, and the convergence rate of related problems is counted.
(2) Business item
And aiming at the display of the verification result, the service index dimension is supported, and the verification failure rate of each index item is counted. The influence of a certain abnormal point position on the overall relevant statistical index can be conveniently and quickly noticed by workers at a PM end and the like.
As shown in FIG. 8, the results of the problem item statistics and/or business item statistics may be presented in a report, such as a showx report.
As shown in FIG. 9, to verify the impact of a service module on a rule and a business, it is expected that the rules are divided into classes, exemplified as follows: the same service can be divided into indexes, rules and rule details, and statistics can be performed according to different indexes or according to different rules.
4. Result tracking processing
The service may get the final verified result and may publish the verification result item at a time sync yesterday (or other period as well) every day.
The QA end regularly sorts the problems, and sorts the problems into two types: a known problem; and adding a new problem.
And aiming at the known problems, whether the personnel on the end have been repaired or not can be judged, if so, the problem type convergence line graph is checked, and if so, the problem state is modified into the repaired problem.
For newly-increased problems, people on end can be searched to help repair the problems, and the problems are marked as known problems.
For the problem which is not considered important by the personnel on the end, the problem can be noted as temporary concern.
In conclusion, a check closed loop path for problem discovery, tracking, repair and regression can be realized.
The prevention of the embodiment of the disclosure is more free and flexible by fishing the check field through the JsonPath, and is suitable for rapidly expanding services and products; richer check types can be set, and the service is supported to be rapidly expanded and used; the verification closed loop path of discovery, tracking, repair and regression of complete problems can be realized, and the method is more suitable for use in actual projects.
In the technical scheme of the disclosure, the acquisition, storage, application and the like of the personal information of the related user all accord with the regulations of related laws and regulations, and do not violate the good customs of the public order.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
FIG. 10 illustrates a schematic block diagram of an example electronic device 1000 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 10, the apparatus 1000 includes a computing unit 1001 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 1002 or a computer program loaded from a storage unit 1008 into a Random Access Memory (RAM) 1003. In the RAM 1003, various programs and data necessary for the operation of the device 1000 can also be stored. The calculation unit 1001, the ROM 1002, and the RAM 1003 are connected to each other by a bus 1004. An input/output (I/O) interface 1005 is also connected to bus 1004.
A number of components in device 1000 are connected to I/O interface 1005, including: an input unit 1006 such as a keyboard, a mouse, and the like; an output unit 1007 such as various types of displays, speakers, and the like; a storage unit 1008 such as a magnetic disk, an optical disk, or the like; and a communication unit 1009 such as a network card, a modem, a wireless communication transceiver, or the like. The communication unit 1009 allows the device 1000 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunication networks.
Computing unit 1001 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 1001 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 1001 executes the respective methods and processes described above, such as the log check method. For example, in some embodiments, the log verification method may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 1008. In some embodiments, part or all of the computer program may be loaded and/or installed onto device 1000 via ROM 1002 and/or communications unit 1009. When the computer program is loaded into RAM 1003 and executed by computing unit 1001, one or more steps of the log checking method described above may be performed. Alternatively, in other embodiments, the computing unit 1001 may be configured to perform the log check method in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The 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, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server with a combined blockchain.
It should be understood that various forms of the flows shown above, reordering, adding or deleting steps, may be used. For example, the steps described in the present disclosure may be executed in parallel or sequentially or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the principle of the present disclosure should be included in the protection scope of the present disclosure.

Claims (21)

1. A log checking method, comprising:
acquiring at least one point location in target log data and a verification rule thereof according to a log point location relationship matched with the target log data to be verified, wherein the log point location relationship comprises a corresponding relationship between the point location in the target log data and the verification rule of the point location;
and verifying the target log data according to the at least one point location in the target log data and the verification rule thereof to obtain a verification result of the target log data.
2. The method of claim 1, further comprising:
searching a log point location relation matched with the target log data in a log rule relation;
the log rule relationship comprises a corresponding relationship between the type identification of the log data and the log point location relationship.
3. The method of claim 2, wherein finding a log point location relationship in a log rule relationship that matches the target log data comprises:
and according to the type identifier of the target log data, searching a log point location relationship matched with the type identifier of the target log data in the log rule relationship.
4. The method according to claim 2 or 3, wherein obtaining at least one point in the target log data and the verification rule thereof according to the log point location relationship matched with the target log data to be verified comprises:
and acquiring a path search expression of the at least one point in the target log data and at least one check rule corresponding to the path search expression according to the log point location relation matched with the target log data.
5. The method of claim 3 or 4, wherein the log rule relationship comprises a first key-value pair stored in a rule base, a key of the first key-value pair being a type identifier of log data, a value of the first key-value pair being a log point location relationship of the log data;
the log point location relationship includes a second key-value pair stored in values of the first key-value pair of the rule base, a key of the second key-value pair is a path search expression of a point location of the log data, and a value of the second key-value pair is at least one check rule of the point location of the log data.
6. The method of any of claims 1 to 5, further comprising:
performing path search on reference log data, and extracting path search expressions of point locations from the reference log data;
setting at least one check rule for the point location of the reference log data;
storing at least one check rule of the point location as a second key value pair in a path search expression of the point location of the reference log data, wherein all the second key value pairs of the reference log data form a log point location relation of the reference log data;
and storing the type identifier of the reference log data and the log point location relation of the reference log data as a first key value pair.
7. The method according to any one of claims 1 to 6, wherein verifying the target log data according to the at least one point location in the target log data and a verification rule thereof to obtain a verification result of the target log data includes:
searching in the target log data to obtain a target field needing to be verified by utilizing a path retrieval expression of a target point position in the log point position relation of the target log data;
and verifying the target field by using a verification rule corresponding to the path retrieval expression of the target point location to obtain a verification result of the target field.
8. The method of any of claims 1 to 7, further comprising:
counting the verification result of the target log data to obtain a problem item and/or a service item of the target log data;
wherein the problem item comprises at least one of a newly added problem, a known problem and a repaired problem obtained by checking the target log data;
the service item comprises a check failure rate and/or a check success rate corresponding to the service index.
9. The method of any of claims 1 to 8, further comprising:
tracking a verification result of the target log data;
and regularly synchronizing the verification result of the target log data in the target time interval.
10. A log-checking apparatus comprising:
the system comprises an acquisition module, a verification module and a verification module, wherein the acquisition module is used for acquiring at least one point location in target log data and a verification rule thereof according to a log point location relationship matched with the target log data to be verified, and the log point location relationship comprises a corresponding relationship between the point location in the target log data and the verification rule of the point location;
and the verification module is used for verifying the target log data according to the at least one point location in the target log data and the verification rule thereof to obtain the verification result of the target log data.
11. The apparatus of claim 10, further comprising:
the searching module is used for searching the log point location relation matched with the target log data in the log rule relation;
the log rule relationship comprises a corresponding relationship between the type identification of the log data and the log point location relationship.
12. The apparatus of claim 11, wherein the lookup module is configured to lookup a log point location relationship matching the type identifier of the target log data in the log rule relationship according to the type identifier of the target log data.
13. The apparatus according to claim 11 or 12, wherein the obtaining module is configured to obtain, according to a log point location relationship that matches the target log data, a path search expression of the at least one point location in the target log data and at least one check rule corresponding to the path search expression.
14. The apparatus of claim 12 or 13, wherein the log rule relationship comprises a first key-value pair stored in a rule base, a key of the first key-value pair being a type identifier of log data, a value of the first key-value pair being a log point location relationship of the log data;
the log point location relationship includes a second key-value pair stored in values of the first key-value pair of the rule base, a key of the second key-value pair being a path search expression of a point location of the log data, and a value of the second key-value pair being at least one check rule of the point location of the log data.
15. The apparatus of any of claims 10 to 14, further comprising:
the path searching module is used for performing path searching on the reference log data and extracting a path searching expression of point positions from the reference log data;
the rule setting module is used for setting at least one check rule for the point location of the reference log data;
the first saving module is used for saving at least one check rule of the point location in a path search expression of the point location of the reference log data as a second key value pair, and all the second key value pairs of the reference log data form a log point location relation of the reference log data;
and the second storage module is used for storing the type identifier of the reference log data and the log point location relation of the reference log data into a first key-value pair.
16. The device according to any one of claims 10 to 15, wherein the checking module is configured to search for a target field to be checked in the target log data by using a path retrieval expression of a target point in a log point location relationship of the target log data; and verifying the target field by using a verification rule corresponding to the path retrieval expression of the target point location to obtain a verification result of the target field.
17. The apparatus of any of claims 10 to 16, further comprising:
the statistical module is used for carrying out statistics on the checking result of the target log data to obtain a problem item and/or a service item of the target log data;
the problem item comprises at least one of a newly added problem, a known problem and a repaired problem obtained by checking the target log data;
the service item comprises a check failure rate and/or a check success rate corresponding to the service index.
18. The apparatus of any of claims 10 to 17, further comprising:
the tracking module is used for tracking the verification result of the target log data;
and the synchronization module is used for synchronizing the verification result of the target log data in a target time interval in a timing mode.
19. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-9.
20. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-9.
21. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-9.
CN202211304701.5A 2022-10-24 2022-10-24 Log checking method, device, equipment and storage medium Pending CN115757057A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211304701.5A CN115757057A (en) 2022-10-24 2022-10-24 Log checking method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211304701.5A CN115757057A (en) 2022-10-24 2022-10-24 Log checking method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115757057A true CN115757057A (en) 2023-03-07

Family

ID=85353058

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211304701.5A Pending CN115757057A (en) 2022-10-24 2022-10-24 Log checking method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115757057A (en)

Similar Documents

Publication Publication Date Title
US9928155B2 (en) Automated anomaly detection service on heterogeneous log streams
CN112052151A (en) Fault root cause analysis method, device, equipment and storage medium
CN108958959B (en) Method and device for detecting hive data table
CN114461644A (en) Data acquisition method and device, electronic equipment and storage medium
CN115437663A (en) Upgrade strategy updating method and device, electronic equipment, storage medium and vehicle
CN114024884A (en) Test method, test device, electronic equipment and storage medium
CN115455091A (en) Data generation method and device, electronic equipment and storage medium
CN111913824A (en) Method for determining data link fault reason and related equipment
US10003492B2 (en) Systems and methods for managing data related to network elements from multiple sources
CN115576831A (en) Test case recommendation method, device, equipment and storage medium
CN115757057A (en) Log checking method, device, equipment and storage medium
CN111694686B (en) Processing method and device for abnormal service, electronic equipment and storage medium
CN114218313A (en) Data management method, device, electronic equipment, storage medium and product
CN110727538B (en) Fault positioning system and method based on model hit probability distribution
CN109426576A (en) Fault-tolerance processing method and fault-tolerant component
CN114500326A (en) Abnormality detection method, abnormality detection device, electronic apparatus, and storage medium
CN113094241A (en) Method, device and equipment for determining accuracy of real-time program and storage medium
CN112604295A (en) Method and device for reporting game update failure, management method and server
CN116610724B (en) Log data tracking method and device, electronic equipment and storage medium
US11924027B1 (en) Detecting network operation validation anomalies in conglomerate-application-based ecosystems systems and methods
CN112988507B (en) Service monitoring method, device, equipment, storage medium and computer program product
CN114611155B (en) Data management node verification method, device, equipment and medium
CN113609145B (en) Database processing method, device, electronic equipment, storage medium and product
CN117056310A (en) Data migration method and device, electronic equipment and storage medium
CN115454800A (en) Log data verification method and device, electronic equipment, storage medium and product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination