CN115795019A - Service log processing method and device, storage medium and electronic device - Google Patents

Service log processing method and device, storage medium and electronic device Download PDF

Info

Publication number
CN115795019A
CN115795019A CN202211131051.9A CN202211131051A CN115795019A CN 115795019 A CN115795019 A CN 115795019A CN 202211131051 A CN202211131051 A CN 202211131051A CN 115795019 A CN115795019 A CN 115795019A
Authority
CN
China
Prior art keywords
target
service
log
logs
server
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
CN202211131051.9A
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.)
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Haier Uplus Intelligent Technology Beijing Co Ltd
Original Assignee
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Haier Uplus Intelligent Technology Beijing 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 Qingdao Haier Technology Co Ltd, Haier Smart Home Co Ltd, Haier Uplus Intelligent Technology Beijing Co Ltd filed Critical Qingdao Haier Technology Co Ltd
Priority to CN202211131051.9A priority Critical patent/CN115795019A/en
Publication of CN115795019A publication Critical patent/CN115795019A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The application discloses a method and a device for processing a service log, a storage medium and an electronic device, which relate to the technical field of intelligent home, and the method comprises the following steps: acquiring a group of logs to be processed of a first server, wherein the group of logs to be processed comprises a system log generated by the first server and a service log generated when the first server executes a target task of a target service; extracting a service log to be analyzed matched with the service identifier of the target service from the group of logs to be processed, wherein the service log to be analyzed is a service log generated when a target task is executed in the group of logs to be processed; according to the method and the device, the problem that operation for checking the service logs is complex due to mixing of the service logs and system logs in a service log processing method in the related art is solved.

Description

Service log processing method and device, storage medium and electronic device
Technical Field
The present application relates to the field of big data, and in particular, to a method and an apparatus for processing a service log, a storage medium, and an electronic apparatus.
Background
Currently, log data (log) of a service can be collected by a service analysis system and processed to analyze the execution process of the service. The business analysis system can be a Flink-based business analysis system, for example, a Flink self-contained log system, and can include a Flink data analysis processing program and a Flink business program. Since when the same service is processed, flink splits the service into multiple tasks (tasks) and distributes these tasks to multiple node servers for execution, that is, multiple tasks of the same service may be executed by multiple node servers. Furthermore, the Flink data analysis processing program is generally a Resource management scheduling performed by a big data yann (Another Resource coordinator) cluster, and the Flink program itself is also a computing engine that runs in a distributed manner on a plurality of node servers, so that log data printed by the business program is also distributed on the plurality of node servers.
However, due to the long link of data processing, if the log data of a service needs to be checked, tasks (tasks) on each server need to be checked one by one, and the log interface needs to be opened for checking, which is time-consuming and labor-consuming when the concurrence is large. Moreover, the log data of the service and the log data of the system are mixed together, so that the operation is complicated when a debugged log needs to find a node server and a task on the node server and also needs to filter the log data of the system.
Therefore, the processing method of the service log in the related art has the problem of complex operation for checking the service log caused by mixing the service log and the system log.
Disclosure of Invention
The embodiment of the application provides a method and a device for processing a service log, a storage medium and an electronic device, which are used for at least solving the problem that the operation of checking the service log is complicated due to the mixing of the service log and a system log in the method for processing the service log in the related technology.
According to an aspect of the embodiments of the present application, a method for processing a service log is provided, including: acquiring a group of logs to be processed of a first server, wherein the group of logs to be processed comprises a system log generated by the first server and a service log generated when the first server executes a target task of a target service; extracting a service log to be analyzed matched with the service identifier of the target service from the group of logs to be processed, wherein the service log to be analyzed is a service log generated when the target task is executed in the group of logs to be processed; analyzing the service log to be analyzed according to the target log parameters to obtain a target analysis result corresponding to the target service, wherein the target analysis result is used for indicating the target service and the parameter values corresponding to the target log parameters.
In an exemplary embodiment, the obtaining a set of pending logs for a first server includes: and copying the log data stream generated by the first server to a target branch task through a target component to obtain the group of logs to be processed, wherein the target branch task is a task for analyzing the service log generated by the first server.
In an exemplary embodiment, the extracting, from the set of logs to be processed, a to-be-analyzed service log that matches the service identifier of the target service includes: extracting a service log matched with the service identifier of each service from the group of logs to be processed according to the service identifier of each service in a plurality of services, wherein the plurality of services are services with corresponding tasks running on the first server, the plurality of services comprise the target service, and the service log matched with the service identifier of the target service is the service log to be analyzed.
In an exemplary embodiment, the analyzing the service log to be analyzed according to the target log parameter to obtain a target analysis result corresponding to the target service includes: under the condition that the target log parameters comprise a group of log parameters, analyzing the service log to be analyzed according to each log parameter in the group of log parameters respectively to obtain an analysis result corresponding to each log parameter, wherein the group of log parameters comprise at least one of the following parameters: the total number of the service logs, the total number of the abnormal service logs and the verification result of the preset index item.
In an exemplary embodiment, after the analyzing the service log to be analyzed according to the target log parameter to obtain a target analysis result corresponding to the target service, the method further includes: and sending the target analysis result to a target log system so that the target log system stores the target analysis result into a target log file in a target file system, wherein the target log file is put into a target file directory corresponding to the target service.
In an exemplary embodiment, after the sending the target analysis result to the target log system, the method further comprises: receiving the target analysis result through the target log system, and storing the target analysis result into a target subject matched with the target service; and sending the target analysis result to a second server according to the subscription information of the target topic, wherein the subscription information of the target topic is used for indicating that the second server subscribes to the target topic.
In an exemplary embodiment, the analysis result corresponding to the target service is saved in different log files in the target file directory by taking a preset time as a unit; the method further comprises the following steps: receiving a query request sent by target equipment through the target file system, wherein the query request is used for querying an analysis result corresponding to the target service in a target time period; acquiring a log file corresponding to the target time period in the target file directory through the target file system to obtain a target query result matched with the query request; and responding to the query request, and sending the target query result to the target equipment through the target file system.
According to another aspect of the embodiments of the present application, there is also provided a device for processing a service log, including: the system comprises a first acquisition unit, a second acquisition unit and a third acquisition unit, wherein the first acquisition unit is used for acquiring a group of logs to be processed of a first server, and the group of logs to be processed comprises a system log generated by the first server and a service log generated when the first server executes a target task of a target service; an extracting unit, configured to extract a service log to be analyzed that is matched with the service identifier of the target service from the set of logs to be processed, where the service log to be analyzed is a service log generated when the target task is executed in the set of logs to be processed; and the analysis unit is used for analyzing the service log to be analyzed according to the target log parameters to obtain a target analysis result corresponding to the target service, wherein the target analysis result is used for indicating the target service and the parameter values corresponding to the target log parameters.
In one exemplary embodiment, the first acquisition unit includes: and the replication module is used for replicating the log data stream generated by the first server to a target branch task through a target component to obtain the group of logs to be processed, wherein the target branch task is a task used for analyzing the service log generated by the first server.
In one exemplary embodiment, the extracting unit includes: and the extracting module is used for extracting a service log matched with the service identifier of each service from the group of logs to be processed according to the service identifier of each service in a plurality of services, wherein the plurality of services are services with corresponding tasks running on the first server, the plurality of services comprise the target service, and the service log matched with the service identifier of the target service is the service log to be analyzed.
In one exemplary embodiment, the analysis unit includes: an analysis module, configured to, when the target log parameter includes a set of log parameters, analyze the service log to be analyzed according to each log parameter in the set of log parameters, to obtain an analysis result corresponding to each log parameter, where the set of log parameters includes at least one of: the total number of the service logs, the total number of the abnormal service logs and the verification result of the preset index item.
In one exemplary embodiment, the apparatus further comprises: and the first sending unit is used for sending the target analysis result to a target log system after the service log to be analyzed is analyzed according to the target log parameters to obtain a target analysis result corresponding to the target service, so that the target analysis result is stored in a target log file in a target file system by the target log system, wherein the target log file is put into a target file directory corresponding to the target service.
In one exemplary embodiment, the apparatus further comprises: a first receiving unit, configured to receive the target analysis result through a target log system after the target analysis result is sent to the target log system, and store the target analysis result in a target topic matched with the target service; and a second sending unit, configured to send the target analysis result to a second server according to subscription information of the target topic, where the subscription information of the target topic is used to indicate that the second server subscribes to the target topic.
In an exemplary embodiment, the analysis result corresponding to the target service is saved in different log files in the target file directory by taking a preset time as a unit; the device further comprises: a second receiving unit, configured to receive, through the target file system, an inquiry request sent by a target device, where the inquiry request is used to inquire an analysis result corresponding to the target service in a target time period; the second acquisition unit is used for acquiring the log file corresponding to the target time period in the target file directory through the target file system to obtain a target query result matched with the query request; and the third sending unit is used for responding to the query request and sending the target query result to the target equipment through the target file system.
In the embodiment of the application, a mode of analyzing a service log corresponding to a target service in an obtained server is adopted, and a group of to-be-processed logs of a first server are obtained, wherein the group of to-be-processed logs comprises a system log generated by the first server and a service log generated when the first server executes a target task of the target service; extracting a service log to be analyzed matched with the service identifier of the target service from the group of logs to be processed, wherein the service log to be analyzed is a service log generated when a target task is executed in the group of logs to be processed; the method comprises the steps of analyzing a service log to be analyzed according to a target log parameter to obtain a target analysis result corresponding to a target service, wherein the target analysis result is used for indicating a parameter value corresponding to the target service and the target log parameter, extracting the service log output from a server by using a service identifier of the service, and analyzing the extracted service log according to the log parameter, so that the purpose of filtering other logs except the service log during log viewing is not needed, the technical effect of improving the convenience of viewing the service log is achieved, and the problem that the operation of viewing the service log is complicated due to the fact that the service log and a system log are mixed in a service log processing method in the related art is solved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art to obtain other drawings without inventive exercise.
Fig. 1 is a schematic diagram of a hardware environment of a method for processing a service log according to an embodiment of the present application;
fig. 2 is a flowchart illustrating an alternative method for processing a service log according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of an alternative log file according to an embodiment of the present application;
FIG. 4 is a system architecture diagram of an alternative business analysis system in accordance with an embodiment of the present application;
FIG. 5 is a schematic diagram of an alternative data processing link according to an embodiment of the present application;
FIG. 6 is a diagram illustrating an alternative method for processing a service log according to an embodiment of the present disclosure;
FIG. 7 is a block diagram of an alternative service log processing apparatus according to an embodiment of the present application;
fig. 8 is a block diagram of an alternative electronic device according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the application described herein may be implemented in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to one aspect of the embodiment of the application, a method for processing a service log is provided. The service log processing method is widely applied to full-House intelligent digital control application scenes such as intelligent homes (Smart Home), intelligent homes, intelligent Home equipment ecology, intelligent House (Intelligent House) ecology and the like. Alternatively, in this embodiment, the processing method of the service log may be applied to a hardware environment formed by the terminal device 102 and the server 104 as shown in fig. 1. As shown in fig. 1, the server 104 is connected to the terminal device 102 through a network, and may be configured to provide a service (e.g., an application service) for the terminal or a client installed on the terminal, set a database on the server or independent of the server, and provide a data storage service for the server 104, and configure a cloud computing and/or edge computing service on the server or independent of the server, and provide a data operation service for the server 104.
The network may include, but is not limited to, at least one of: wired networks, wireless networks. The wired network may include, but is not limited to, at least one of: wide area networks, metropolitan area networks, local area networks, which may include, but are not limited to, at least one of the following: WIFI (Wireless Fidelity), bluetooth. Terminal equipment 102 can be but not limited to be PC, the cell-phone, the panel computer, intelligent air conditioner, intelligent cigarette machine, intelligent refrigerator, intelligent oven, intelligent kitchen range, intelligent washing machine, intelligent water heater, intelligent washing equipment, intelligent dish washer, intelligent projection equipment, intelligent TV, intelligent clothes hanger, intelligent (window) curtain, intelligence audio-visual, smart jack, intelligent stereo set, intelligent audio amplifier, intelligent new trend equipment, intelligent kitchen guarding equipment, intelligent bathroom equipment, intelligence robot of sweeping the floor, intelligence robot of wiping the window, intelligence robot of mopping the ground, intelligent air purification equipment, intelligent steam ager, intelligent microwave oven, intelligent kitchen is precious, intelligent clarifier, intelligent water dispenser, intelligent lock etc..
The method for processing the service log according to the embodiment of the present application may be executed by the server 104, or may be executed by the terminal device 102, or may be executed by both the server 104 and the terminal device 102. The method for the terminal device 102 to execute the service log according to the embodiment of the present application may also be executed by a client installed thereon.
Taking the method for processing the service log in the embodiment executed by the server 104 as an example, fig. 2 is a schematic flow chart of an optional method for processing the service log according to the embodiment of the present application, and as shown in fig. 2, the flow of the method may include the following steps:
step S202, a group of to-be-processed logs of the first server is obtained, where the group of to-be-processed logs includes a system log generated by the first server and a service log generated when the first server executes a target task of a target service.
The service log processing method in this embodiment may be applied to a scenario in which a service log generated by a server is analyzed, and a task log corresponding to a target service in a first server is acquired to analyze the target service. The target service may be a service currently being processed or completed by the first server. The target service may be split into a plurality of tasks, and all tasks in the target service may be directly processed by the same server, in which case the first server is one server, for example, the first server may be a cluster server capable of executing all tasks of the target service, or different parts of the tasks in the plurality of tasks are handed over to different servers for processing, in which case the first server includes a plurality of servers, for example, the first server may be a node server capable of executing part of tasks of the target service.
The analysis of the target traffic may use a Flink-based traffic analysis system. In the related art, when a Flink self-contained log system (i.e., a Yarn-dependent log management system) processes the same service by using the Flink, in order to improve the efficiency of service processing, a target service may be split into a plurality of tasks, and the tasks may be distributed to a plurality of node servers for execution. The Flink data analysis processing program generally performs resource management scheduling through a big data yann cluster, and the Flink program is also a computing engine which runs in a distributed mode on a plurality of nodes, so that logs printed by the self business program are also distributed on each node server.
For example, inside the Flink program, the debug information and the basic data information of the service (for example, the number of data pieces, key index information, and the like, where the key index information may be point location information of a buried point, whether it is empty, whether it is an abnormal value, or not) are printed by the original log4j (log operation packet), println (print delivery parameter), and log printing by the task manager of the Flink. When the data of the service is checked, the node servers and the task on the node servers are checked one by one, and the log interface is opened for checking, so that time and labor are consumed when the concurrency is large, and the logs of the service and the logs of the system are mixed together, and the logs of the system are filtered, so that the operation is very inconvenient.
In order to reduce the tedious operations of checking the logs, in this embodiment, a set of service log collecting and storing system for a real-time or batch processing program of Flink is provided, which may obtain log data generated by a server running a target service or a part of tasks of the target service, and filter the service log of the target service from the generated log data by using a service identifier of the target service, so that the log data (i.e., system log) of the system itself does not need to be manually filtered, and the checking operation of the service log may be simplified.
In this embodiment, the first server (which may be a server for performing service log analysis other than the first server, and in this embodiment, the first server is taken as an example for description) may obtain a set of logs to be processed of the first server, where the logs to be processed may include one or more logs, a system log (for example, an operation log of a system, a load log of a central processing unit, a memory, a magnetic disk, and the like) generated by the first server, a service log generated when the first server executes a target task of a target service (the target task may be all or part of a task of the target service), and other logs, which is not limited in this embodiment.
Optionally, a branch Task (branch Task) corresponding to the target Task may be run on the first server, and data may be synchronously copied from the log data stream of the first server through the branch Task, so as to obtain a group of to-be-processed logs. For example, the system for collecting the flexk service logs can be divided into two parts of log collection and log unified storage, wherein in the log collection part, while the flexk service processing is normally performed, a flexk branch (or called a data branch for log analysis or a branch for log analysis and extraction, i.e., a branch Task) for log analysis and extraction is defined as follows:
val businessStream=env.addSource(KafkaSource).setParallelism(10)
val streamLog=businessStream
the log analysis data branch can copy a part of data to the branch Task by using a Flink data routing function, and the branch Task realizes the analysis of the service log. Because the data subjected to log analysis is data synchronously copied from a DataStream, the processing process and the business logic are parallel and independent and do not influence each other. In addition, debug information for debugging (e.g., debug information obtained through a buried point) may be added, and the log service may simultaneously process business logic and log extraction streamlog.sink (Kafka) using the function of multiple Sink (i.e., data target) of Flink.
Step S204, extracting a service log to be analyzed matched with the service identifier of the target service from the group of logs to be processed, wherein the service log to be analyzed is a service log generated when the target task is executed in the group of logs to be processed.
In this embodiment, after obtaining a set of to-be-processed logs, the analysis server may extract, from the set of to-be-processed logs, a to-be-analyzed log matched with the target service identifier according to the service identifier of the target service. The log to be analyzed is a service log generated when a target task is executed in a group of logs to be processed.
Optionally, the service identifier of the target service may include a group of service sub identifiers corresponding to different service data of the target service, and the terminal device may extract the log to be analyzed, which is matched with the required service sub identifier, from the log to be processed by using different service sub identifiers according to different logs of the required service data.
Step S206, analyzing the service log to be analyzed according to the target log parameters to obtain a target analysis result corresponding to the target service, wherein the target analysis result is used for indicating the target service and the parameter values corresponding to the target log parameters.
After a group of logs to be analyzed are extracted, the analysis server can analyze the logs to be processed to obtain an analysis result corresponding to the target service. The method for analyzing the log to be processed by the terminal device may be one or more methods, and the method may be to analyze the log to be processed according to the target log parameter, for example, an Application Programming Interface (API) corresponding to the target log parameter is called, and the log to be processed is transmitted to the corresponding API to analyze the log to be processed, or analyze the log to be processed by other methods, which is not limited in this embodiment. The target log parameter includes one or more of the following parameters, which may include but are not limited to at least one of: the number of data pieces, the key index item (index item for evaluating data quality), and correspondingly, the analyzing the service log to be analyzed according to the target log parameter may include, but is not limited to, at least one of the following: calculating the number of data (count), checking key index items and the like. And the target analysis result is used for representing the parameter values corresponding to the target service and the target log parameters.
For example, the log analysis data branch may perform log analysis on the key data pieces, data quality, and the like, and the log analysis result may be sent to a log Kafka (a high-throughput distributed publish-subscribe messaging system), and the log analysis may include at least one of: analyzing the point location information of the buried point in the log to be processed, for example, judging whether the point location is a null value or an abnormal value; and analyzing the number of the logs in the log to be processed to obtain the total number of the logs and the number of the usable logs.
Through the steps, a group of logs to be processed of the first server is obtained, wherein the group of logs to be processed comprises a system log generated by the first server and a service log generated when the first server executes a target task of a target service; extracting a service log to be analyzed matched with a service identifier of a target service from a group of logs to be processed, wherein the service log to be analyzed is a service log generated when a target task is executed in the group of logs to be processed; analyzing the service log to be analyzed according to the target log parameter to obtain a target analysis result corresponding to the target service, wherein the target analysis result is used for indicating a parameter value corresponding to the target service and the target log parameter, so that the problem that the operation of checking the service log is complicated due to the mixing of the service log and the system log in a service log processing method in the related art is solved, and the convenience of checking the service log is improved.
In one exemplary embodiment, obtaining a set of pending logs for a first server comprises:
s11, the log data stream generated by the first server is copied to a target branch task through the target component to obtain a group of logs to be processed, wherein the target branch task is a task for analyzing the service log generated by the first server.
When the service log analysis is performed, the first server may directly perform to-be-processed log processing on the log data stream output by the first server. However, the log data stream directly output to the first server may affect the normal operation of the service processing on the first server. In this embodiment, the collecting of the service log may be performed by a target branch task on the first server, and the component controlling the target branch task to be performed is a target component, for example, a Flink component, and the processing of the log stream data may be performed by the target component copying the log data stream of the first server onto the branch task.
The target component may be a component on the terminal device, and the target component is used for providing a function of data stream replication. The first server may copy the log data stream on the first server to the target branch Task (i.e., the aforementioned branch Task) via the target component. The target branch task is used for analyzing a service log of a target service on the first server. Optionally, when the first server includes multiple services, the first server may copy the log data stream on the first server to a branch task corresponding to a different service, so as to obtain multiple sets of to-be-processed logs. The process of collecting and analyzing the service log of each service is similar to that of collecting and analyzing the service log of the target service, and is not described herein again.
For example, the multi-path copy feature of the flag is utilized to extract the service log concurrently, so that the service log is stripped from a large amount of complex system logs, the problem in the service analysis process can be quickly located, and the influence on the original service processing process can be reduced by decoupling the service log processing and the service processing process.
By the embodiment, the log data stream is copied to the branch task to collect and analyze the service data, so that the service processing process and the service log processing process can be decoupled, and the processing speed of the service log is increased.
In an exemplary embodiment, extracting a service log to be analyzed that matches a service identifier of a target service from a set of service logs to be processed includes:
s21, extracting a service log matched with the service identifier of each service from a group of logs to be processed according to the service identifier of each service in the plurality of services, wherein the plurality of services are services with corresponding tasks running on a first server, the plurality of services comprise target services, and the service log matched with the service identifier of the target service is a service log to be analyzed.
The first server may run one or more tasks of multiple services, and correspondingly, the obtained group of processing logs may include service logs of multiple services including the target service. After the logs to be processed are obtained, the first server may extract, from a group of logs to be processed, a service log matched with the service identifier of each service according to the service identifier corresponding to each service, where the service log matched with the service representation of the target service is a service log to be analyzed.
It should be noted that, a group of logs to be processed may also be copied for different services, and a group of logs to be processed corresponding to each service is used to collect and process the service logs of the service. And the service logs of each service are respectively obtained through a group of logs to be processed, so that the memory resources and the computing resources required by log collection and analysis can be reduced, and the rationality of resource utilization is improved.
By the embodiment, the service logs of different services are obtained through the group of logs to be processed, so that memory resources and computing resources required by log collection and analysis can be reduced, and the rationality of resource utilization is improved.
In an exemplary embodiment, analyzing a service log to be analyzed according to a target log parameter to obtain a target analysis result corresponding to a target service, includes:
s31, under the condition that the target log parameters comprise a group of log parameters, analyzing the service log to be analyzed according to each log parameter in the group of log parameters respectively to obtain an analysis result corresponding to each log parameter, wherein the group of log parameters comprise at least one of the following parameters: the total number of the service logs, the total number of the abnormal service logs and the verification result of the preset index item.
In this embodiment, the target log parameter may include a set of log parameters. The first server may analyze the service log to be analyzed according to each log parameter in the group of log parameters, respectively, to obtain an analysis result corresponding to each log parameter. Similarly to the foregoing embodiment, a group of log parameters may be parameters for processing different types of log data, for example, a parameter for counting the total number of service logs, a parameter for calculating the total number of abnormal service logs, and a parameter for checking a preset index, which have already been described and are not described herein again.
For example, the processing procedure of the key data may be evaluated, which may include a subscription total amount, an abnormal data amount, a data condition of an actual business entry analysis, and the like, and the data may be extracted and stored uniformly, so as to facilitate tracking and positioning of the data processing procedure.
By the embodiment, the service logs are analyzed based on at least one of the total number of the service logs, the total number of the abnormal service logs and the verification result of the preset index item, so that the convenience and the efficiency of service log processing can be improved.
In an exemplary embodiment, after analyzing the service log to be analyzed according to the target log parameter to obtain a target analysis result corresponding to the target service, the method further includes:
s41, sending the target analysis result to a target log system so that the target log system stores the target analysis result in a target log file in a target file system, wherein the target log file is put into a target file directory corresponding to the target service.
After obtaining the target analysis result corresponding to the target service, the terminal device may save the target analysis result to a local storage (e.g., a local disk) so that a use object of the terminal device (e.g., a user of the terminal device) may be viewed locally. In order to facilitate other users to view and debug the target analysis result, in this embodiment, the target analysis result may be sent to the target log system.
The collection and analysis of traffic logs may be performed on each server or may be performed on a separate analysis server, e.g., a target log system. When the service logs are collected and analyzed by the servers, because there may be an association relationship in processing logic between different services of the target service, for example, a service on one node server is executed first (an upstream service is executed on an upstream server), and then a service on the next node server is executed (a downstream service is executed on a downstream server). Correspondingly, performing a service log analysis on a downstream server may require the results of the service log analysis of the upstream server.
In this embodiment, the first server may send the target analysis result to the target log system, and the target log system stores the target analysis result in a target log file in the target file system, where the target log file is placed in a target file directory corresponding to the target service. If the target log system contains a target file directory corresponding to the target service, the target log file can be stored in the target file directory corresponding to the target service, if the target log system does not contain the target file directory corresponding to the target service, a new file directory can be created to serve as the target file directory corresponding to the target service, and then the target log file is placed in the target file directory corresponding to the target service in the target file system.
The target file system may be the same system as the target log system, or may be another system for processing the target analysis result, which is different from the target log system, for example, a distributed file system, or may be another system having a log processing function, which is not limited in this embodiment.
For example, for log storage, the log Kafka may be subscribed by a Flink program, that is, service log information of the log Kafka is subscribed, and the service log information is stored in a File of an HDFS (Hadoop Distributed File System) in real time, where one service may correspond to one HDFS directory. The service log information in the HDFS directory may be rolled in time, and the service log information may be stored for a certain period of time (e.g., 1 month). By checking the HDFS log file, the data condition of each link of the link can be conveniently tracked and positioned.
Optionally, for a scenario where the first server has an upstream server, it may subscribe to a target topic corresponding to the target service in the target log system. Correspondingly, the first server can obtain an association analysis result corresponding to the target service on the association server from the target log system; and analyzing the service log to be analyzed and the associated analysis result according to the target log parameters to obtain a target analysis result corresponding to the target service. Here, the association server may be an upstream server of the first server, and the obtaining of the association analysis result corresponding to the target service on the association server from the target log system may be: and acquiring a correlation analysis result corresponding to the target service on the correlation server in the target topics sent by the target log system, wherein the target topics are the topics which are subscribed by the first server and correspond to the target service.
By the embodiment, the analysis result of the service log is stored in the log system, so that the efficiency and convenience of service log processing can be improved.
In an exemplary embodiment, after sending the target analysis result to the target log system, the method further includes:
s51, receiving a target analysis result through a target log system, and storing the target analysis result into a target theme matched with the target service;
and S52, sending the target analysis result to the second server according to the subscription information of the target topic, wherein the subscription information of the target topic is used for indicating that the second server subscribes to the target topic.
In this embodiment, for the target log system, the target log system (for example, a log server of the target log system) may receive the target analysis result sent by the first server, and store the target analysis result in the target topic. The target theme is a theme matched with the target service. The target log system may have a plurality of topics, and each topic stores a service log analysis result of a corresponding service. A node server corresponding to the target service (e.g., a node server running at least one service of the target service) may subscribe to the target topic, and may also subscribe to a service log analysis result generated by a certain node server (an upstream server) under the target topic.
The target log system may send the target analysis result to a subscriber of the target topic according to subscription information of the target topic, where the subscription information is used to indicate a node server subscribed to the target topic, or subscribe to a service log analysis result produced by a first server under the target topic, that is, the target analysis result. After receiving the target analysis result, the target log system may determine, according to the subscription information of the target topic, a node server (e.g., a second server) to which the target analysis result is to be sent, and send the target analysis result to the node server subscribed to the target topic.
Optionally, the target log system may determine that the target file system subscribes to the target topic according to subscription information of the target topic, and send the target analysis result to the target file system. The target file system may include the service log analysis result under the target topic for a preset duration (e.g., 1 day, 1 week). Optionally, the target log system receives the target analysis result, or receives the target analysis result corresponding to the target service through Kafka (Apache Kafka, a distributed publish-subscribe message system). Kafka can function as a data buffer, which can improve the throughput of log processing. The target log system can receive the target analysis result through Kafka and store the target analysis result in a theme corresponding to the target service under Kafka. The HDFS can obtain a service log analysis result corresponding to the target service by subscribing the theme corresponding to the target service in the Kafka, and stores the analysis result into a log file of the target service.
For example, the Flink log parser may subscribe to the log Kafka and store the log Kafka to a corresponding HDFS directory file, that is, streamlog. Compared with the problems of dispersion of the original Yarn/Flink log system, mixed service self-printing logs/system logs and large total log amount, the log file stored according to the method has the advantages that the convenience of log tracking and positioning can be improved as shown in fig. 3.
By the embodiment, the analysis result of the service log is sent to the corresponding subscriber in a topic subscription mode, so that the convenience of service processing can be improved.
In an exemplary embodiment, the analysis result corresponding to the target service is saved in different log files in the target file directory by taking a preset time length as a unit; the method further comprises the following steps:
s61, receiving a query request sent by target equipment through a target file system, wherein the query request is used for querying an analysis result corresponding to a target service in a target time period;
s62, acquiring a log file corresponding to a target time period in a target file directory through a target file system to obtain a target query result matched with the query request;
and S63, responding to the query request, and sending the target query result to the target equipment through the target file system.
In this embodiment, the target file directory may store a plurality of log files, where the plurality of log files may be analysis results corresponding to the target service according to a certain rule, for example, the analysis results corresponding to the target service may be stored in the corresponding log files according to a preset time duration (for example, days, months, and the like), the analysis results corresponding to the target service may also be stored in the corresponding files according to a data size of the analysis results corresponding to the target service, or the analysis results corresponding to the target service may also be stored in the corresponding log files according to other manners, which is not limited in this embodiment.
When the user wants to view the analysis result corresponding to the target service, the user may perform a query operation on the target device to trigger generation of a query request. The query operation may include one or more of the following, but may not be limited to at least one of: click operation, double click operation, slide operation, etc. The target device may detect a query operation, and generate a query request in response to the detected query operation, where the query is used to query an analysis result corresponding to the target service in the target time period. The target device may be a personal computer, a mobile phone terminal, or other devices of the user.
The target file system can receive the query request, determine a file directory corresponding to the target service, record one or more log files of an analysis result corresponding to the target service in the target time period, obtain the analysis result corresponding to the target time period from the log files, obtain a target query result, and send the target query result to the target device. Optionally, the target device may also directly obtain an analysis result corresponding to the target service by subscribing to a topic corresponding to the target service. The manner of obtaining the analysis result corresponding to the target service through subscription is similar to that in the foregoing embodiment, and is not described herein again.
By the embodiment, the analysis result matched with a certain time period is inquired from the file system through the inquiry request, so that the convenience of checking the service log can be improved, and the use experience of a user is improved.
The following explains a method for processing a service log in the embodiment of the present application with reference to an optional example. In this optional example, the target log system is a LogKafka system, the target file system is an HDFS file, the target log parameters include the total number of service logs, the total number of abnormal service logs, and the check result of the key index item, and the target analysis result is a service analysis result.
In the related art, for the application of Flink in a business analysis system, a data processing link is long, and in the data processing process of each step, a Flink analysis program lacks a function of data integral perception, so that each step lacks a check on the actual condition of data, for example, how to know the actual data quality and the number of data pieces actually used in business analysis, the number of wrong data pieces, and the like, cannot be conveniently known, and thus the quality of a final data result lacks basic evaluation. In addition, when the final result is abnormal, re-subscription and debug are required in steps, which causes inconvenience in positioning.
In order to solve at least part of the above problems, this optional example provides an efficient collection method for a service log in a data processing process, and by using a unified collection method for a service log, a key target of an analysis result is flexibly defined and a quality analysis of result data is performed.
The method for processing the service log in this optional example may be applied to a Flink-based service analysis system, which may be a service log extraction and collection system, for example, a system that flexibly defines a key target of an analysis result and performs quality analysis on result data in a unified service log collection manner. As shown in fig. 4 and 5, the system architecture of the business analysis system may include the following modules:
business Core (Flink Core traffic processing module) is responsible for traffic analysis and logic processing, the main application scenario is to subscribe upstream Kakfa Data, and perform Data ETL (Extract Transform Load, data warehouse technology) or Data analysis processing according to the requirement, for example, count conversion rate index of Data Stream, etc., each Flink module (each Flink in fig. 5 is a Flink module on a node server), is only responsible for a single traffic processing, and sends the Data result to downstream secondary and tertiary intermediate buffer Kafka.
Log Service (Log processing module) comprising: the log process (log analysis module) is responsible for analyzing the service data, the log msgsourcer (producer model) is responsible for constructing a message sending class and the log msgsink (log message sending module) is responsible for transmitting the log data, and the total amount of the service data, the error service data and the quality inspection of the service data can be analyzed according to the service analysis requirements to analyze the overall processing quality of the data.
The Log service (Log processing module) is different from the system Log, and is used for performing data total evaluation, error data evaluation, data quality inspection and the like on the service Log according to service analysis requirements, and analyzing the overall processing quality of data according to the embedded service Log.
A fin Multi Sinkprocess (fin mux module) responsible for sending data to downstream buffers, which may support at least one of the following databases: mysql, hbase, hdfs, hive.
The Biz Kafka (Kafka data processing module) is responsible for caching data reported by the buried points, results after service analysis and data related to service processing.
And the Log Kafka (Kafka Log processing module) is responsible for receiving data transmitted by the Flink Multi Sinkprocess and storing the data into a corresponding theme, wherein the Log used by the system is stored into the theme (topic) of the Log Kafka system and is subscribed and processed through the Flink.
And the HDFS File (HDFS File system) subscribes the service log information through the flash and stores the service log into a corresponding File directory.
As shown in fig. 6, the flow of the service log processing method in this optional example may include the following steps:
step 1, defining a Flink branch for log analysis and extraction while the Flink business processing is normally carried out.
The node server can split the service data to different service processing units for processing through the service identifier, and meanwhile, the node server collects and analyzes the service logs and distributes the data to be processed to different Flink branches.
And 2, performing log analysis on the data number, the data quality and the like by using the log analysis data branch, adding debugged information, and simultaneously processing service logic and log extraction by using the function of multi-path output of the Flink.
The Flink branch comprises a service analysis program module, a log extraction module of data quality or other stream processing modules, and different modules can be selected for analysis according to different requirements to obtain a service analysis result.
And 3, subscribing Kafka log subjects through a Flink log analysis program, storing log data in the log subjects to corresponding HDFS directory files in a log file form, and segmenting the log files according to days.
And the log collection Kafka (or the log collection Kafka) distributes the service analysis results of different services to the downstream Kafka according to the service identification or stores the service analysis results into an HDFS file.
And 4, searching a corresponding log analysis result in the HDFS log file under the condition of receiving the query request, so that the data condition of each link of the link can be conveniently tracked and positioned.
By the optional example, the log extraction and the service processing are decoupled, so that the log extraction and the service processing can be executed concurrently, the service log can be checked efficiently and conveniently, the service log is clear and definite, and the efficiency of checking the service log is greatly improved; the service log can be well combined with the original service system and can be added in a modular mode, so that the new log printing expansion is facilitated; and the data visualization analysis system can be conveniently accessed through a log format of standardized output, and trend analysis is carried out on the result data.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (e.g., a ROM (Read-Only Memory)/RAM (Random Access Memory), a magnetic disk, an optical disk) and includes several instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the methods according to the embodiments of the present application.
According to another aspect of the embodiment of the present application, a device for processing a service log is further provided, which is used for implementing the method for processing a service log. Fig. 7 is a block diagram of a structure of an alternative service log processing apparatus according to an embodiment of the present application, and as shown in fig. 7, the apparatus may include:
a first obtaining unit 702, configured to obtain a set of to-be-processed logs of a first server, where the set of to-be-processed logs includes a system log generated by the first server and a service log generated when the first server executes a target task of a target service;
an extracting unit 704, connected to the first obtaining unit 702, configured to extract a service log to be analyzed that is matched with a service identifier of a target service from a set of logs to be processed, where the service log to be analyzed is a service log generated when a target task is executed in the set of logs to be processed;
and the analyzing unit 706 is connected to the extracting unit 704, and is configured to analyze the service log to be analyzed according to the target log parameter to obtain a target analysis result corresponding to the target service, where the target analysis result is used to indicate the target service and a parameter value corresponding to the target log parameter.
It should be noted that the first obtaining unit 702 in this embodiment may be configured to execute the step S202, the extracting unit 704 in this embodiment may be configured to execute the step S204, and the analyzing unit 706 in this embodiment may be configured to execute the step S206.
Acquiring a group of logs to be processed of a first server through the module, wherein the group of logs to be processed comprises a system log generated by the first server and a service log generated when the first server executes a target task of a target service; extracting a service log to be analyzed matched with a service identifier of a target service from a group of logs to be processed, wherein the service log to be analyzed is a service log generated when a target task is executed in the group of logs to be processed; analyzing the service log to be analyzed according to the target log parameter to obtain a target analysis result corresponding to the target service, wherein the target analysis result is used for indicating a parameter value corresponding to the target service and the target log parameter, so that the problem that the operation of checking the service log is complicated due to the mixing of the service log and the system log in a service log processing method in the related art is solved, and the convenience of checking the service log is improved.
In one exemplary embodiment, the first acquisition unit includes:
the replication module is used for replicating the log data stream generated by the first server to a target branch task through the target component to obtain a group of logs to be processed, wherein the target branch task is a task used for analyzing the service log generated by the first server.
In one exemplary embodiment, the extraction unit includes:
the extraction module is used for extracting a service log matched with the service identifier of each service from a group of logs to be processed according to the service identifier of each service in a plurality of services, wherein the plurality of services are services which run corresponding tasks on a first server, the plurality of services comprise target services, and the service log matched with the service identifier of the target service is a service log to be analyzed.
In one exemplary embodiment, the analysis unit includes:
the analysis module is configured to, when the target log parameter includes a set of log parameters, analyze the service log to be analyzed according to each log parameter in the set of log parameters, and obtain an analysis result corresponding to each log parameter, where the set of log parameters includes at least one of the following: the total number of the service logs, the total number of the abnormal service logs and the verification result of the preset index item.
In an exemplary embodiment, the apparatus further includes:
and the first sending unit is used for analyzing the service log to be analyzed according to the target log parameters to obtain a target analysis result corresponding to the target service, and then sending the target analysis result to the target log system so that the target log system stores the target analysis result into a target log file in a target file system, wherein the target log file is put into a target file directory corresponding to the target service.
In an exemplary embodiment, the apparatus further includes:
the first receiving unit is used for receiving the target analysis result through the target log system after the target analysis result is sent to the target log system, and storing the target analysis result into a target subject matched with the target service;
and the second sending unit is used for sending the target analysis result to the second server according to the subscription information of the target topic, wherein the subscription information of the target topic is used for indicating that the second server subscribes to the target topic.
In an exemplary embodiment, the analysis result corresponding to the target service is saved in different log files in the target file directory by taking a preset time length as a unit; the above-mentioned device still includes:
the second receiving unit is used for receiving a query request sent by the target equipment through the target file system, wherein the query request is used for querying an analysis result corresponding to the target service in the target time period;
the second acquisition unit is used for acquiring the log files corresponding to the target time period in the target file directory through the target file system to obtain a target query result matched with the query request;
and the third sending unit is used for responding to the query request and sending the target query result to the target equipment through the target file system.
It should be noted here that the modules described above are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the disclosure of the above embodiments. It should be noted that the modules described above as a part of the apparatus may be operated in a hardware environment as shown in fig. 1, and may be implemented by software, or may be implemented by hardware, where the hardware environment includes a network environment.
According to still another aspect of an embodiment of the present application, there is also provided a storage medium. Optionally, in this embodiment, the storage medium may be configured to execute a program code of any one of the service log processing methods in this embodiment of the present application.
Optionally, in this embodiment, the storage medium may be located on at least one of a plurality of network devices in a network shown in the above embodiment.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps:
s1, acquiring a group of logs to be processed of a first server, wherein the group of logs to be processed comprises a system log generated by the first server and a service log generated when the first server executes a target task of a target service;
s2, extracting a service log to be analyzed matched with the service identifier of the target service from the group of logs to be processed, wherein the service log to be analyzed is a service log generated when the target task is executed in the group of logs to be processed;
and S3, analyzing the service log to be analyzed according to the target log parameters to obtain a target analysis result corresponding to the target service, wherein the target analysis result is used for indicating the target service and the parameter values corresponding to the target log parameters.
Optionally, the specific example in this embodiment may refer to the example described in the above embodiment, which is not described again in this embodiment.
Optionally, in this embodiment, the storage medium may include, but is not limited to: various media capable of storing program codes, such as a U disk, a ROM, a RAM, a removable hard disk, a magnetic disk, or an optical disk.
According to another aspect of the embodiments of the present application, there is also provided an electronic device for implementing the method for processing a service log, where the electronic device may be a server, a terminal, or a combination thereof.
Fig. 8 is a block diagram of an alternative electronic device according to an embodiment of the present application, as shown in fig. 8, including a processor 802, a communication interface 804, a memory 806, and a communication bus 808, where the processor 802, the communication interface 804, and the memory 806 are in communication with each other via the communication bus 808, where,
a memory 806 for storing a computer program;
the processor 802, when executing the computer program stored in the memory 806, performs the following steps:
s1, acquiring a group of logs to be processed of a first server, wherein the group of logs to be processed comprises a system log generated by the first server and a service log generated when the first server executes a target task of a target service;
s2, extracting a service log to be analyzed matched with the service identifier of the target service from the group of logs to be processed, wherein the service log to be analyzed is a service log generated when the target task is executed in the group of logs to be processed;
and S3, analyzing the service log to be analyzed according to the target log parameters to obtain a target analysis result corresponding to the target service, wherein the target analysis result is used for indicating the target service and the parameter values corresponding to the target log parameters.
Alternatively, in this embodiment, the communication bus may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 8, but this is not intended to represent only one bus or type of bus. The communication interface is used for communication between the electronic device and other equipment.
The memory may include RAM, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory. Alternatively, the memory may be at least one memory device located remotely from the processor.
As an example, the memory 806 may include, but is not limited to, the first obtaining unit 702, the extracting unit 704, and the analyzing unit 706 in the processing device that includes the service log. In addition, the service log processing apparatus may further include, but is not limited to, other module units in the service log processing apparatus, which is not described in detail in this example.
The processor may be a general-purpose processor, and may include but is not limited to: a CPU (Central Processing Unit), an NP (Network Processor), and the like; but also a DSP (Digital Signal Processing), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
It can be understood by those skilled in the art that the structure shown in fig. 8 is only an illustration, and the device implementing the method for processing the service log may be a terminal device, and the terminal device may be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a Mobile Internet Device (MID), a PAD, and the like. Fig. 8 is a diagram illustrating a structure of the electronic device. For example, the electronic device may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in FIG. 8, or have a different configuration than shown in FIG. 8.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disk, ROM, RAM, magnetic or optical disk, and the like.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the related art may be embodied in the form of a software product stored in a storage medium, and including instructions for causing one or more computer devices (which may be personal computers, servers, network devices, or the like) to execute all or part of the steps of the method described in the embodiments of the present application.
In the above embodiments of the present application, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, and may also be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution provided in the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (10)

1. A method for processing a service log is characterized by comprising the following steps:
acquiring a group of logs to be processed of a first server, wherein the group of logs to be processed comprises a system log generated by the first server and a service log generated when the first server executes a target task of a target service;
extracting a service log to be analyzed matched with the service identifier of the target service from the group of logs to be processed, wherein the service log to be analyzed is a service log generated when the target task is executed in the group of logs to be processed;
analyzing the service log to be analyzed according to the target log parameters to obtain a target analysis result corresponding to the target service, wherein the target analysis result is used for indicating the target service and the parameter values corresponding to the target log parameters.
2. The method of claim 1, wherein obtaining a set of pending logs for the first server comprises:
and copying the log data stream generated by the first server to a target branch task through a target component to obtain the group of logs to be processed, wherein the target branch task is a task for analyzing the service log generated by the first server.
3. The method according to claim 1, wherein the extracting a service log to be analyzed from the set of service logs to be processed, which matches the service identifier of the target service, comprises:
extracting a service log matched with the service identifier of each service from the group of logs to be processed according to the service identifier of each service in a plurality of services, wherein the plurality of services are services with corresponding tasks running on the first server, the plurality of services comprise the target service, and the service log matched with the service identifier of the target service is the service log to be analyzed.
4. The method according to claim 1, wherein the analyzing the service log to be analyzed according to the target log parameter to obtain a target analysis result corresponding to the target service includes:
under the condition that the target log parameters comprise a group of log parameters, analyzing the service log to be analyzed according to each log parameter in the group of log parameters respectively to obtain an analysis result corresponding to each log parameter, wherein the group of log parameters comprise at least one of the following parameters: the total number of the service logs, the total number of the abnormal service logs and the verification result of the preset index item.
5. The method according to any one of claims 1 to 4, wherein after the analyzing the service log to be analyzed according to the target log parameter to obtain a target analysis result corresponding to the target service, the method further comprises:
and sending the target analysis result to a target log system so that the target log system stores the target analysis result into a target log file in a target file system, wherein the target log file is put into a target file directory corresponding to the target service.
6. The method of claim 5, wherein after said sending the target analysis results to a target logging system, the method further comprises:
receiving the target analysis result through the target log system, and storing the target analysis result into a target subject matched with the target service;
and sending the target analysis result to a second server according to the subscription information of the target topic, wherein the subscription information of the target topic is used for indicating that the second server subscribes to the target topic.
7. The method according to claim 5, wherein the analysis result corresponding to the target service is saved in different log files in the target file directory in a unit of a preset time length; the method further comprises the following steps:
receiving a query request sent by target equipment through the target file system, wherein the query request is used for querying an analysis result corresponding to the target service in a target time period;
acquiring a log file corresponding to the target time period in the target file directory through the target file system to obtain a target query result matched with the query request;
and responding to the query request, and sending the target query result to the target equipment through the target file system.
8. An apparatus for processing a service log, comprising:
the system comprises a first acquisition unit, a second acquisition unit and a third acquisition unit, wherein the first acquisition unit is used for acquiring a group of logs to be processed of a first server, and the group of logs to be processed comprises a system log generated by the first server and a service log generated when the first server executes a target task of a target service;
an extracting unit, configured to extract a service log to be analyzed that is matched with the service identifier of the target service from the set of logs to be processed, where the service log to be analyzed is a service log generated when the target task is executed in the set of logs to be processed;
and the analysis unit is used for analyzing the service log to be analyzed according to the target log parameters to obtain a target analysis result corresponding to the target service, wherein the target analysis result is used for indicating the target service and the parameter values corresponding to the target log parameters.
9. A computer-readable storage medium, comprising a stored program, wherein the program when executed performs the method of any of claims 1 to 7.
10. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method of any of claims 1 to 7 by means of the computer program.
CN202211131051.9A 2022-09-16 2022-09-16 Service log processing method and device, storage medium and electronic device Pending CN115795019A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211131051.9A CN115795019A (en) 2022-09-16 2022-09-16 Service log processing method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211131051.9A CN115795019A (en) 2022-09-16 2022-09-16 Service log processing method and device, storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN115795019A true CN115795019A (en) 2023-03-14

Family

ID=85432006

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211131051.9A Pending CN115795019A (en) 2022-09-16 2022-09-16 Service log processing method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN115795019A (en)

Similar Documents

Publication Publication Date Title
US11736378B1 (en) Collaborative incident management for networked computing systems
CN108200111B (en) Resource configuration information updating method and device and resource interface equipment
CN110928851B (en) Method, device and equipment for processing log information and storage medium
CN108632111A (en) Service link monitoring method based on log
CN110928934A (en) Data processing method and device for business analysis
CN108390793A (en) A kind of method and device of analysis system stability
CN110928681A (en) Data processing method and device, storage medium and electronic device
CN112765514A (en) Method, device and storage medium for monitoring network public sentiment
CN110941632A (en) Database auditing method, device and equipment
CN112181678A (en) Service data processing method, device and system, storage medium and electronic device
CN113792008A (en) Method and device for acquiring network topology structure, electronic equipment and storage medium
CN112445861B (en) Information processing method, device, system and storage medium
CN109639494B (en) Statistical method, device, server and storage medium of interface information
CN110297748A (en) The method, apparatus and computer readable storage medium of error are called in a kind of positioning
CN116820874A (en) Enterprise-level big data component and method for monitoring and alarming application
CN110138720B (en) Method and device for detecting abnormal classification of network traffic, storage medium and processor
CN110989537A (en) Production data processing method, apparatus, medium, and system
CN111026616A (en) Information processing method and device, electronic equipment and storage medium
CN115795019A (en) Service log processing method and device, storage medium and electronic device
CN108959041B (en) Method for transmitting information, server and computer readable storage medium
CN112199275B (en) Component interface test analysis method and device, server and storage medium
Savolainen et al. Conflict-centric software architectural views: Exposing trade-offs in quality requirements
CN115499333A (en) Method, system, storage medium and electronic device for determining association relationship
CN111177126B (en) Information processing method, device and equipment
CN112822075A (en) Service link tracking method and related device

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