Log management and analysis method and device, storage medium and computer program product

Through the combination of log collector and visual analysis tools, large-scale log files are processed using secure and encrypted communication methods, solving the problems of low efficiency and insufficient security in traditional log systems in distributed environments, achieving efficient and secure log management and analysis.

CN118964321APending Publication Date: 2024-11-15ZHONGDIAN DATA IND CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411159798.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

Traditional logging systems are difficult to adapt to in large-scale distributed environments, resulting in low efficiency in management and analysis of large-scale log files and insufficient security, and often have retrieval difficulties, log loss and thread blocking problems.

Method used

Use a log collector to collect log files in real time and send them to search engines in a secure communication manner for persistent storage. Use visual analysis tools to retrieve and analyze log data from search engines in encrypted communication, reduce the use of computing resources and ensure data security and reliability.

Benefits of technology

It realizes efficient management and analysis of large-scale log files, avoiding log loss and excessive computing resource utilization, and ensuring data security and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118964321A_ABST
    Figure CN118964321A_ABST
Patent Text Reader

Abstract

The invention discloses a log management and analysis method and device, a storage medium and a computer program product, and relates to the technical field of data management, and the method comprises the steps: collecting each node log file through a log collector; storing each node log file in a search engine in a secure communication mode to obtain log data; retrieving to-be-processed data from the log data according to a preset index statement in the search engine, and sending the to-be-processed data to the visual analysis tool in an encrypted communication mode; and monitoring and analyzing the to-be-processed data based on a visual analysis tool to obtain a log management analysis result. The data security of the log data is ensured in a secure communication mode and an encrypted communication mode, a large amount of log data is efficiently managed and analyzed in combination with a visual analysis tool, a log collector and a search engine, and a log management analysis result is quickly returned.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data management technology, and in particular to log management and analysis methods, devices, storage media, and computer program products. Background Art

[0002] In distributed systems and microservice architectures, log files are scattered across multiple services and hosts according to deployment methods. As the data volume of existing large systems continues to grow, traditional log systems are difficult to adapt to large-scale distributed environments and are limited in scalability. Using traditional log systems to manage and analyze log files of large systems requires a lot of computing resources. At the same time, due to the weak data processing and analysis capabilities of traditional log management and analysis mechanisms and low security configuration, retrieval difficulties, log loss, and thread blocking problems occur frequently.

[0003] Therefore, how to efficiently manage and analyze large amounts of log files while ensuring data security has become a technical problem that needs to be solved urgently.

[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0005] The main purpose of this application is to provide a log management and analysis method, device, storage medium and computer program product, aiming to solve the technical problem of efficiently managing and analyzing large amounts of log files while ensuring data security.

[0006] To achieve the above objectives, the present application proposes a log management and analysis method, which is applied to a log processing system. The log processing system includes a log collector, a search engine, and a visual analysis tool. The method includes:

[0007] Collect the log files of each node through the log collector;

[0008] Storing the log files of each node to the search engine in a secure communication manner to obtain log data;

[0009] Retrieving the data to be processed from the log data according to a preset index statement in the search engine, and sending the data to be processed to the visual analysis tool in an encrypted communication manner;

[0010] The data to be processed is monitored and analyzed based on the visual analysis tool to obtain log management analysis results.

[0011] In one embodiment, the log files of each node are stored in the search engine in a secure communication manner, and before the step of obtaining the log data, the step further includes:

[0012] Obtaining a cluster address of the search engine;

[0013] Edit the security communication configuration file of the log collector according to the cluster address;

[0014] The secure communication configuration file is started to construct a secure communication mode between the log collector and the search engine.

[0015] In one embodiment, before the step of retrieving the data to be processed from the log data according to the preset index statement in the search engine and sending the data to be processed to the visual analysis tool in an encrypted communication manner, the step further includes:

[0016] Obtaining an encrypted communication configuration file between the search engine and the visual analysis tool;

[0017] Setting encrypted communication conditions according to the encrypted communication configuration file and specifying actual use paths of the preset key store and trust store;

[0018] An encrypted communication method between the search engine and the visual analysis tool is established based on the actual use path and the encrypted communication condition.

[0019] In one embodiment, before the step of retrieving the data to be processed from the log data according to the preset index statement in the search engine, the step further includes:

[0020] Get log data management strategy;

[0021] Configure log search logic according to the log data management strategy;

[0022] An index statement for the log data is created in the search engine according to the log search logic.

[0023] In one embodiment, the step of retrieving the data to be processed from the log data according to the preset index statement in the search engine includes:

[0024] Creating a corresponding index pattern in the visual analysis tool according to the index statement;

[0025] The data to be processed is retrieved from the log data based on the index pattern.

[0026] In one embodiment, the step of monitoring and analyzing the data to be processed based on the visual analysis tool to obtain the log management analysis result includes:

[0027] Creating visualization charts and dashboards based on the visualization analysis function of the visualization analysis tool;

[0028] Get preset alarm rules;

[0029] The data to be processed is analyzed according to the visualization chart, the dashboard, and the preset alarm rules to obtain a log management analysis result.

[0030] In one embodiment, after the step of analyzing the data to be processed based on the visual analysis tool to obtain the log management analysis result, the step further includes:

[0031] The search engine is integrated with a preset monitoring tool to comprehensively monitor the log data.

[0032] In addition, to achieve the above-mentioned objectives, the present application also proposes a log management and analysis device, which includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the computer program is configured to implement the steps of the log management and analysis method described above.

[0033] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the log management and analysis method described above are implemented.

[0034] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the log management and analysis method described above are implemented.

[0035] One or more technical solutions proposed in this application have at least the following technical effects:

[0036] The log files of each node are collected in real time through the log collector, and the large number of log files generated by each node are sent to the search engine for storage in a secure communication mode to ensure the security and reliability of the data; the visual analysis tool and the search engine are connected in an encrypted communication mode, which not only ensures the security of the log data, but also enables the visual analysis tool to obtain the pending data that needs to be managed and analyzed from the large amount of log data stored by the search engine, rather than managing and analyzing the node log files in real time, thus occupying less computing resources; the visual tool with powerful data processing and analysis capabilities is used to monitor and analyze the pending data, and the visual log management and analysis results are quickly returned to achieve efficient management and analysis of large-volume log files. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] 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 present application.

[0038] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0039] Figure 1 A flowchart of the first embodiment of the log management and analysis method of the present application is provided;

[0040] Figure 2 A flowchart of the second embodiment of the log management and analysis method of the present application;

[0041] Figure 3 A flowchart of the third embodiment of the log management and analysis method of the present application;

[0042] Figure 4 A flowchart of the fourth embodiment of the log management and analysis method of the present application;

[0043] Figure 5 A flowchart of the seventh embodiment of the log management and analysis method of the present application;

[0044] Figure 6 A flow chart of log file management and analysis using Elasticsearch, Filebeat, and Kibana as examples provided for this application

[0045] Figure 7 This is a schematic diagram of the module structure of the log management and analysis device according to an embodiment of the present application;

[0046] Figure 8 Schematic diagram of the device structure of the hardware operating environment involved in the log management and analysis method in the embodiment of the present application.

[0047] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0048] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0049] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0050] The main solution of the embodiment of the present application is: collect the log files generated by each node of the large system through a log collector, and send the log files of each node to the search engine for persistent storage in a secure communication manner to ensure data security and reliability; connect the visualization analysis tool with the search engine in an encrypted communication manner to facilitate the visualization analysis tool to retrieve the log data persistently stored in the search engine to obtain the data to be processed, and use the visualization analysis function of the visualization analysis tool to monitor and analyze the data to be processed to obtain the log management analysis results.

[0051] The embodiment of the present application takes into account that: since the existing log management and analysis system needs to occupy a large amount of computing resources to process the log files scattered on multiple servers and hosts in real time, it is difficult to manage and analyze large system log files with large volume of data, and the data processing and analysis capabilities are relatively weak. Enabling security settings will have a certain impact on the analysis capabilities of the existing log system, especially in a high-load or resource-constrained environment, which will cause the data analysis capabilities of the existing log system to be further weakened, so the security settings are not enabled in the existing log system. At the same time, since enabling security settings requires compatibility with the existing log system, different security settings are configured for different versions of log systems, and complex version matching and settings are also one of the reasons why the security configuration of the existing log system is not high. The weak data analysis and processing capabilities and low security configuration of the log system lead to frequent retrieval difficulties, log loss, thread blocking and other problems in the process of managing and analyzing large volumes of log files using the existing log management and analysis mechanism.

[0052] Therefore, the present application provides a solution, through the log collector, the node log files generated by each server device and application during operation are sent to the search engine for persistent storage in a secure communication mode. When log file management and analysis are required, the visual analysis tool is connected to the search engine in an encrypted communication mode, so that the visual analysis tool retrieves the pending data that needs to be managed and analyzed from the search engine storage, and manages and analyzes the pending data, instead of processing the node log files generated in real time, occupying less computing resources, so that large-volume log files can be efficiently managed and analyzed. Data is transmitted and searched through secure communication methods and encrypted communication methods, so that in the process of managing and analyzing log files, the problem of log loss no longer occurs, ensuring the security and reliability of data. Establishing secure communication methods and encrypted communication methods as security settings will not cause incompatibility with the log processing system, and can help achieve efficient processing of large-volume log files.

[0053] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a log processing system, etc. The following takes the log processing system as an example to illustrate this embodiment and the following embodiments.

[0054] Based on this, the embodiment of the present application provides a log management and analysis system method, which is applied to a log processing system. The log processing system includes a log collector, a search engine, and a visual analysis tool. The visual analysis tool and the search engine are connected in an encrypted communication manner. Figure 1 , Figure 1 This is a flow chart of the first embodiment of the log management and analysis method of the present application.

[0055] In this embodiment, the log management and analysis method includes steps S10 to S40:

[0056] Step S10, collecting log files of each node through the log collector;

[0057] Since log management and analysis is performed on a system with large amounts of data, in order to minimize the use of computing resources, avoid thread blocking, and achieve efficient management and analysis, it is necessary to use a lightweight log collector that occupies less system resources.

[0058] Specifically, in a feasible implementation, the step S10 of collecting log files of each node through the log collector may include: selecting Filebeat as the log collector to collect log files generated by each server device and application during operation, including user activity records, error information, performance indicators, etc. Filebeat is deployed on the server or container that generates the log file, monitors the specified log file or log stream, and collects the latest log file in real time.

[0059] It should be noted that Filebeat is a lightweight log file collector specially designed for collecting and forwarding log files. Filebeat can monitor single or multiple log files and send new content to the specified output location when new content is written to the file.

[0060] The above is only a feasible implementation of step S10 provided in this embodiment, and this embodiment does not specifically limit the specific implementation of step S10.

[0061] Step S20, storing the log files of each node to the search engine in a secure communication manner to obtain log data;

[0062] The node log files are sent to the search engine in a secure communication mode. The search engine stores a large number of node log files persistently, obtains the log data generated by each server device and application during operation, sends data in a secure communication mode to ensure data security and reliability, stores a large number of log files, selects the data that needs to be managed and analyzed from the stored log data for processing, and no longer manages and analyzes the log files generated in real time in real time, reduces the occupation of computing resources, and avoids problems such as thread blocking.

[0063] Since search engines need to store a large number of log files persistently and be able to retrieve components so that they can subsequently retrieve the unprocessed data that needs to be managed and analyzed from the stored log data, it is necessary to select a search engine that can quickly store, search, and analyze large amounts of data.

[0064] Specifically, in a feasible implementation, the log files of each node are stored in the search engine in a secure communication manner, and step S20 of obtaining log data may include: selecting Elasticsearch as the search engine, and sending the collected log files of each node to Elasticsearch for persistent storage through a log collector in a secure communication manner to obtain log data.

[0065] It should be noted that Elasticsearch is an open source, distributed data analysis and search engine built on Apache Lucene. It can quickly store, search and analyze large amounts of data, and is usually used to implement complex search functions. It is designed to process PB-level data and can search and analyze data in near real-time. Therefore, Elasticsearch is selected as the search engine for the log processing system.

[0066] The above is only a feasible implementation of step S20 provided in this embodiment, and this embodiment does not specifically limit the specific implementation of step S20.

[0067] Step S30, retrieving the data to be processed from the log data according to the preset index statement in the search engine, and sending the data to be processed to the visual analysis tool in an encrypted communication manner;

[0068] The visual analysis tool is connected to the search engine in an encrypted communication mode, so that the visual analysis tool can retrieve the pending data that needs to be processed from the log data stored by the search engine while ensuring data security.

[0069] The log processing system uses Kibana as a visual analysis tool. Kibana is an open source analysis and visualization platform that provides a rich graphical interface and allows users to build and execute real-time queries through an intuitive interface. It has powerful data processing and analysis capabilities.

[0070] Step S40: monitor and analyze the data to be processed based on the visual analysis tool to obtain a log management analysis result.

[0071] Kibana obtains the pending data that needs to be managed and analyzed from the search engine, monitors and deeply analyzes the pending data, finds abnormal patterns, performance bottlenecks, error logs, and security events in the pending data, and uses Kibana's aggregation and filtering functions to deeply explore the pending data, find the root causes of abnormal patterns and performance bottlenecks, and present the management and analysis results in a visual way so that users can more intuitively understand the log management and analysis process.

[0072] This embodiment provides a log management and analysis method, which collects log files of each node in real time through a log collector, and sends a large number of log files generated by each node to a search engine for storage in a secure communication manner, thereby ensuring the security and reliability of the data; connecting a visualization analysis tool and a search engine in an encrypted communication manner not only ensures the security of the log data, but also enables the visualization analysis tool to obtain pending data that needs to be managed and analyzed from a large amount of log data stored by the search engine, rather than managing and analyzing the node log files in real time, thereby occupying less computing resources; using a visualization tool with powerful data processing and analysis capabilities to monitor and analyze the pending data, quickly returning the visualization log management analysis results, and realizing efficient management and analysis of large volumes of log files.

[0073] Based on the first embodiment of the present application, the second embodiment of the present application is proposed. In the second embodiment of the present application, the same or similar contents as those of the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following.

[0074] On this basis, please refer to Figure 2 , storing the log files of each node to the search engine in a secure communication manner, and before the step S20 of obtaining the log data, the steps S121 to S123 are also included:

[0075] Step S121, obtaining the cluster address of the search engine;

[0076] The log collector sends the node log files to the search engine for storage. In order to ensure the security of data transmission, a secure communication channel is established between the log collector and the search engine to ensure that the log collector can send a large number of node log files generated by each server device and application during operation to the search engine in a secure communication manner.

[0077] Taking Filebeat as the log collector and Elasticsearch as the search engine as an example, Filebeat needs to obtain the HTTPS address and port of the Elasticsearch cluster before sending the collected node log files to Elasticsearch.

[0078] Step S122, editing the security communication configuration file of the log collector according to the cluster address;

[0079] Take Filebeat as the log collector as an example, edit the secure communication configuration file of the log collector to establish a secure communication method. Set output.elasticsearch.hosts in the filebeat.yml secure communication configuration file of Filebeat to specify the Elasticsearch cluster HTTPS address and port to which the node log file needs to be sent. If you need to send the node log file to multiple cluster addresses, you only need to arrange multiple cluster addresses, and Filebeat will automatically perform load balancing.

[0080] The secure communication between Filebeat and Elasticsearch requires SSL / TLS configuration to be enabled. Set ssl.enabled to true in the secure communication configuration file to enable SSL / TLS, and set ssl.certificate_authorities to specify the file path containing the CA certificate. Filebeat will use this CA certificate to verify the certificate of the Elasticsearch server to ensure that secure communication is successfully established.

[0081] Step S123: start the secure communication configuration file to build a secure communication mode between the log collector and the search engine.

[0082] After editing the secure communication configuration file of the log collector, save and close the Filebeat configuration file, and restart the Filebeat service to make the edited secure communication configuration file take effect. Check the log output of Filebeat to ensure that there are no SSL / TLS related errors, try to send experimental log events to Elasticsearch, and verify whether the sent log events have been successfully received by Elasticsearch. If Elasticsearch successfully receives the experimental log events, it proves that the secure communication method between the log collector and the search engine has been established.

[0083] In this embodiment, by obtaining the cluster address of the search engine, it is ensured that the log collector can send the log files of each node to the correct location of the search engine, the security communication configuration file of the log collector is edited according to the cluster address, SSL / TLS communication is started, and a secure communication method is established between the log collector and the search engine to avoid the loss of log files and achieve efficient management of large-volume log files.

[0084] Based on the first embodiment and / or the second embodiment of the present application, the third embodiment of the present application is proposed. In the third embodiment of the present application, the same or similar contents as those of the above-mentioned first and second embodiments can be referred to the above introduction, and will not be repeated in the following.

[0085] On this basis, please refer to Figure 3 , Figure 3 This is a flow chart of the third embodiment of the log management and analysis method of the present application.

[0086] In this embodiment, the step of retrieving the data to be processed from the log data according to the preset index statement in the search engine and sending the data to be processed to the visual analysis tool in an encrypted communication manner also includes steps S1 to S3:

[0087] Step S1, obtaining an encrypted communication configuration file of the search engine and the visual analysis tool;

[0088] Since the visual analysis tool obtains the log data to be processed and analyzed from the search engine, in order to ensure the integrity and security of the data during this data transmission process, achieve efficient management and analysis of log files, and avoid log loss and other phenomena, it is necessary to establish an encrypted communication channel between the visual analysis tool and the search engine. By establishing an encrypted communication channel, the data to be processed is sent to the visual analysis tool in an encrypted communication manner, which not only ensures the secure transmission of data, but is also one of the important measures to protect the log processing system from potential threats.

[0089] Taking Elasticsearch as a search engine and Kibana as a visual analysis tool as an example, the establishment of an encrypted communication channel between the visual analysis tool and the search engine is described in detail. To establish an encrypted communication channel between the visual analysis tool and the search engine, it is necessary to obtain the encrypted communication configuration files of the search engine and the visual analysis tool. The encrypted communication configuration file of the Elasticsearch search engine is elasticsearch.yml, and the encrypted communication configuration file of Kibana is kibana.yml. The encrypted communication configuration file is generally located in the config subdirectory of the installation directory. You can obtain the encrypted communication configuration file by querying the installation directories of Elasticsearch and Kibana.

[0090] Step S2, setting encrypted communication conditions according to the encrypted communication configuration file, and specifying actual use paths of the preset key library and trust library;

[0091] Because the search engine and visual analysis tool are connected in encrypted communication, the key store and trust store need to be set in advance to obtain encryption and decryption codes.

[0092] First, in the encrypted communication configuration file of the search engine Elasticsearch: elasticsearch.yml, set the encrypted communication condition xpack.security.transport.ssl.enabled to true to enable SSL / TLS encrypted communication, and use the Java keytool tool to generate a keystore and a truststore. Among them, the keystore is generated according to the self-signed certificate of the search engine, and the self-signed certificate is exported to a separate file. The trusted certificate of the node certificate is verified on this separate file to create a truststore.

[0093] Furthermore, in the elasticsearch.yml encrypted communication configuration file of the search engine, the path of the preset keystore is set by the xpack.security.transport.ssl.keystore.path command, which specifies the path from which Elasticsearch should load the encryption code to encrypt the data to be processed. The decryption code of the truststore is used by setting the xpack.security.transport.ssl.truststore.path command.

[0094] Furthermore, since the search engine sends the data to be processed to the visual analysis tool and manages and analyzes the data to be processed, the encrypted communication configuration file kibana.yml of the visual analysis tool also needs to set the encrypted communication condition of server.ssl.enabled to true to enable SSL / TLS encrypted communication and specify the use path of the key store and trust store.

[0095] Step S3, constructing an encrypted communication method between the search engine and the visualization analysis tool based on the actual usage path and the encrypted communication condition.

[0096] After setting the corresponding encrypted communication conditions and the actual use paths of the key store and trust store for the encrypted communication configuration files of the search engine and the visual analysis tool, the establishment of the encrypted communication channel between the search engine and the visual analysis tool is completed, so that the visual analysis tool can retrieve the pending data that needs to be processed from the log data persistently stored by the search engine in an encrypted communication manner.

[0097] In this embodiment, by editing the encrypted communication configuration files of the search engine and the visual analysis tool, setting the encrypted communication conditions, and specifying the actual usage paths of the preset key library and the trust library, an encrypted communication method is constructed between the search engine and the visual analysis tool to ensure the security and reliability of data transmission, avoid the loss of log files, and achieve efficient management of large-volume log files.

[0098] Based on the above embodiments of the present application, a fourth embodiment of the method of the present application is proposed. In the fourth embodiment of the present application, the same or similar contents as those in the above embodiments can be referred to the above introduction, and will not be repeated in the following.

[0099] On this basis, please refer to Figure 4 , Figure 4 This is a flow chart of the fourth embodiment of the log management and analysis method of the present application.

[0100] In this embodiment, before retrieving the data to be processed from the log data according to the preset index statement in the search engine in step S30, steps S231 to S233 are also included:

[0101] Step S231, obtaining a log data management strategy;

[0102] After the visual analysis tool is connected to the search engine, it retrieves the pending data that needs to be managed and analyzed from the large amount of log data persistently stored in the search engine. To retrieve the pending data that meets the conditions from the massive amount of data, it is necessary to create a corresponding index in the search engine and match a specific query condition with the log data. By entering the query condition in the visual analysis tool, the corresponding pending data can be quickly obtained.

[0103] By querying the official documentation of the log processing system, you can obtain policy recommendations for log data management, and develop an appropriate log data management strategy based on specific needs and actual conditions.

[0104] Step S232, configuring the log search logic according to the log data management strategy;

[0105] Define the fields to be retrieved in the log data according to the log data management policy, and search and filter based on this field to implement the configuration of the log search logic. The fields to be retrieved in the log data include timestamp, log level, service name, message content, etc.

[0106] Step S233: Create an index statement for the log data in the search engine according to the log search logic.

[0107] For example, taking Elasticsearch as a search engine, the process of creating a log data index statement in the search engine is described. Creating a log data index statement in Elasticsearch involves the creation of Elasticsearch index mapping and index documents.

[0108] First, define the index mapping according to the structure of the log data. For example, if the log data contains fields such as timestamp, log level, message content, etc., then you need to define these fields and their types in the index mapping. In Elasticsearch, use the PUT request to create an index and define the mapping.

[0109] Furthermore, once the index mapping is defined, log data can be indexed according to the log search logic. In Elasticsearch, a single document or multiple documents can be indexed using a POST request, where each document represents a log record. For example, to index a single log document, the POST / my_logs_index / _doc statement is used for indexing. My_logs_index / _doc / 1 is the document ID and type. The document ID can be changed as needed, but each document ID must be unique in the index.

[0110] Finally, to verify that the index statement was created correctly, run a GET request and use the search API to query and retrieve log data.

[0111] In this embodiment, by obtaining the log data management strategy, configuring the log search logic according to the log data management strategy, and creating an index statement in the search engine according to the log search logic, a basis is provided for the visual analysis tool to perform retrieval in the search engine, thereby achieving efficient management of large amounts of log data.

[0112] Based on the above embodiments of the present application, a fifth embodiment of the method of the present application is proposed. In the fifth embodiment of the present application, the same or similar contents as those in the above embodiments can be referred to the above introduction, and will not be repeated in the following.

[0113] In this embodiment, the step of retrieving the data to be processed from the log data according to the preset index statement in the search engine in step S30 may include steps S301 to S302:

[0114] Step S301, creating a corresponding index pattern in the visual analysis tool according to the index statement;

[0115] Although the index statements and encrypted communication channels corresponding to the log data are created in the search engine, if you need to directly query and analyze the data in the search engine in the visual analysis tool, you still need to create an index pattern for the visual analysis tool, and the index pattern corresponds to the index statement. By creating an index pattern, you can directly query and analyze the log data in the search engine in the visual analysis tool without writing complex query statements, thus achieving efficient management and analysis of log data.

[0116] Taking Kibana as a visual analysis tool, the steps to create an index pattern corresponding to the indexed statement are described in detail. Enter the name of the index pattern to be created in the Kibana web page. The index pattern name corresponds to the index statement of the log data.

[0117] Step S302: Retrieve the data to be processed from the log data based on the index pattern.

[0118] Add the index pattern to the list of available index patterns. Select the index pattern to query and analyze data related to the index in Kibana to obtain the processed data that needs to be managed and analyzed.

[0119] In this embodiment, the visualization analysis tool is connected to the search engine, and an index pattern corresponding to the index statement is created in the visualization analysis tool to improve the security, convenience and ease of use of the data, and enable users to more conveniently query, analyze and display the data stored in the search engine on the visualization interface, thereby achieving efficient management and analysis of log data.

[0120] Based on the above embodiments of the present application, a sixth embodiment of the present application is proposed. In the sixth embodiment of the present application, the same or similar contents as those in the above embodiments can be referred to the above introduction, and will not be described in detail later.

[0121] In this embodiment, the step S40 of monitoring and analyzing the data to be processed based on the visual analysis tool to obtain the log management analysis result may include steps S401 to S403:

[0122] Step S401, creating a visualization chart and a dashboard according to the visualization analysis function of the visualization analysis tool;

[0123] To create visual charts and dashboards based on the visual analysis function of the visual analysis tool, you need to select the appropriate chart type to display and analyze the log data based on the data type of the log data. Common chart types provided by the visual analysis tool include: line charts, bar charts, pie charts, scatter plots, heat maps, etc. By selecting the appropriate chart type to create a dashboard, you can monitor and analyze the data to be processed later and obtain the log management analysis results.

[0124] Taking Kibana as a visual analysis tool, for example, through Kibana's Discover function, you can view all data in the current index mode, filter data based on search, access each document in each index that matches the selected index mode, submit search queries, filter search results, and view document data. In addition, Kibana's time filter can accurately analyze data within a specific time period. For example, if an index contains a time field, you can use a time filter to limit search results to a specific time period.

[0125] Kibana provides a variety of visualization charts, such as data tables, bar charts, line charts, maps, etc. After selecting the appropriate visualization type, configure the visualization parameters according to the type and characteristics of the data to be processed. The visualization parameters include display fields, aggregation types, etc. The dashboard is a panel that brings together multiple visualization charts. Multiple visualization types can be combined on the dashboard to quickly analyze the data to be processed.

[0126] Step S402, obtaining preset alarm rules;

[0127] Kibana can set up an alarm mechanism through the Watcher plug-in. The Watcher plug-in defines trigger conditions, such as when a certain indicator exceeds or falls below a certain threshold, and specifies the actions to be performed when the conditions are met, such as sending emails or Slack messages. By obtaining the preset alarm rules, abnormal situations in the data to be processed can be judged.

[0128] Step S403: monitor and analyze the data to be processed according to the visualization chart, the dashboard, and the preset alarm rules to obtain a log management analysis result.

[0129] Through visual analysis tools, such as Kibana's data visualization function, complex log data to be processed can be converted into intuitive and easy-to-understand charts, such as bar charts, line charts, pie charts, etc. It can clearly show the overall trend of the data to be processed, the fluctuation of key indicators, and the occurrence of abnormal data.

[0130] The dashboard is a collection of multiple visualization types that can provide a comprehensive overview of the system status. Through the dashboard, you can quickly analyze the key indicators, performance status, and security status of the data to be processed.

[0131] According to the preset alarm rules, when the system that generates log data encounters an abnormal situation or key indicators exceed the threshold, an alarm message is generated to prompt.

[0132] Combine visual charts, dashboards, and preset alarm rules to monitor and analyze the data to be processed and obtain log management analysis results. Monitor the operating status of the system based on the log management analysis results to ensure the stability and security of the system. Once the system is abnormal, take corresponding measures based on the log management analysis results to quickly locate the root cause of the problem and improve the efficiency of troubleshooting.

[0133] In this embodiment, a visualization chart and a dashboard are created through the visualization analysis function of the visualization analysis tool, and the data to be processed are monitored and analyzed in combination with preset alarm rules to obtain log management analysis results. Among them, the dashboard and visualization chart clearly show the overall trend of the data to be processed, the fluctuation of key indicators and the appearance of abnormal data, so as to achieve efficient analysis of the data to be processed. The data to be processed obtained through encrypted communication is managed and analyzed, and the technical problem of efficient management and analysis of large-volume log files is solved under the premise of ensuring data security.

[0134] Based on the above embodiments of the present application, a seventh embodiment of the present application is proposed. In the sixth embodiment of the present application, the same or similar contents as those in the above embodiments can be referred to the above introduction, and will not be described in detail later.

[0135] Please refer to Figure 5 , Figure 5 A flow chart of the seventh embodiment of the log management and analysis method provided for the present application.

[0136] In this embodiment, after the step S40 of analyzing the data to be processed based on the visual analysis tool to obtain the log management analysis result, the following steps are further included:

[0137] Step S50, integrating the search engine with a preset monitoring tool to comprehensively monitor the log data.

[0138] Since the search engine persistently stores a large number of node log files, in order to ensure the security of the log data in the search engine, the search engine is integrated with the preset monitoring tool by utilizing the scalability of the search engine to comprehensively monitor the log data.

[0139] You can choose Prometheus and Grafana as preset integrated tools for comprehensive monitoring. Among them, Prometheus's monitoring and metric data collection functions provide more comprehensive contextual information for log management. By combining log data and metric data, you can have a deeper understanding of the system's operating status and performance bottlenecks. Through Grafana's dashboard and visualization functions, log data is associated with other monitoring data (such as CPU, memory, network, etc.) to form a more intuitive monitoring view, which can quickly discover system problems and conduct corresponding analysis and processing.

[0140] In this embodiment, the scalability of the search engine is utilized to integrate the search engine with a preset monitoring tool to comprehensively monitor the log data, providing a more flexible log management solution to adapt to the scenario of analyzing and managing a large amount of log data in a large system.

[0141] Reference Figure 6 , Figure 6 This application provides a flow chart of log file management and analysis using Elasticsearch, Filebeat, and Kibana as examples.

[0142] like Figure 6 As shown in the figure, Filebeat is used to collect log data generated by various server devices and applications during operation, including user activity records, error information, performance indicators, etc. Set configuration items such as output.elasticsearch.hosts, ssl.certificate_authorities, and ssl.certificate to ensure that it uses the correct SSL / TLS settings to communicate securely with Elasticsearch.

[0143] Furthermore, Elasticsearch receives log files from Filebeat and stores the data so that it can be efficiently searched and analyzed. Based on the management policy, the log search logic is configured, and the indexed logs can be searched and analyzed in a complex manner through Elasticsearch's query DSL to perform statistics and aggregation on the data.

[0144] Furthermore, connect Kibana to Elasticsearch and create an index pattern corresponding to one or more indexes in Elasticsearch to obtain the data to be processed. After creating the index pattern, you can view various fields and values ​​of log data in Kibana according to the query conditions, and create visualization charts and dashboards through visualization and analysis functions to monitor the system status and set alarm rules. For Kibana, you also need to set SSL / TLS related configurations in the kibana.yml configuration file, including server.ssl.enabled, server.ssl.key, server.ssl.certificate, etc., to ensure that the communication between Kibana and Elasticsearch is also encrypted.

[0145] According to the above content, we first collect log files from each node through Filebeat, store them in Elasticsearch and provide retrieval, and finally use Kibana for real-time display and system monitoring.

[0146] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the log management and analysis method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0147] This application also provides a log management and analysis device, please refer to Figure 7 , the log management and analysis device comprises:

[0148] The collection module 10 is used to collect log files of each node;

[0149] Filebeat is selected as the log collector to collect log files generated by various server devices and applications during operation, including user activity records, error information, performance indicators, etc. Deploy Filebeat on the server or container that generates log files, monitor the specified log files or log streams, and collect the latest log files in real time.

[0150] The storage module 20 is used to store the log files of each node to the search engine in a secure communication manner to obtain log data;

[0151] The node log files are sent to the search engine in a secure communication mode. The search engine stores a large number of node log files persistently, obtains the log data generated by each server device and application during operation, sends data in a secure communication mode to ensure data security and reliability, stores a large number of log files, selects the data that needs to be managed and analyzed from the stored log data for processing, and no longer manages and analyzes the log files generated in real time in real time, reduces the occupation of computing resources, and avoids problems such as thread blocking.

[0152] A retrieval module 30, configured to retrieve the data to be processed from the log data according to a preset index statement in the search engine, and send the data to be processed to the visual analysis tool in an encrypted communication manner;

[0153] Since the visual analysis tool is connected to the search engine in an encrypted communication mode, under the premise of ensuring data security, the visual analysis tool can be used to retrieve the unprocessed data that needs to be log managed and analyzed from the log data stored by the search engine.

[0154] The processing module 40 is used to monitor and analyze the data to be processed according to the visual analysis tool to obtain log management analysis results.

[0155] Obtain the pending data that needs to be managed and analyzed from the search engine, monitor and deeply analyze the pending data, find abnormal patterns, performance bottlenecks, error logs, and security events in the pending data, use the aggregation and filtering functions of the visual analysis tool to deeply explore the pending data, find the root causes of abnormal patterns and performance bottlenecks, and present the management and analysis results in a visual way so that users can more intuitively understand the log management and analysis process.

[0156] The log management and analysis device provided by the present application adopts the log management and analysis method in the above embodiment, which can solve the technical problems of log management and analysis. Compared with the prior art, the beneficial effects of the log management and analysis device provided by the present application are the same as the beneficial effects of the log management and analysis method provided by the above embodiment, and the other technical features in the log management and analysis device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0157] The present application provides a log management and analysis device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the log management and analysis method in the above-mentioned embodiment one.

[0158] Reference below Figure 8 , which shows a schematic diagram of the structure of a log management and analysis device suitable for implementing an embodiment of the present application. The log management and analysis device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 8 The log management and analysis device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0159] like Figure 8 As shown, the log management and analysis device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the log management and analysis device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the log management and analysis device to communicate wirelessly or wired with other devices to exchange data. Although the figure shows a log management and analysis device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.

[0160] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0161] The log management and analysis device provided by the present application adopts the log management and analysis method in the above embodiment to solve the technical problems of log management and analysis. Compared with the prior art, the beneficial effects of the log management and analysis device provided by the present application are the same as the beneficial effects of the log management and analysis method provided by the above embodiment, and the other technical features in the log management and analysis device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0162] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0163] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0164] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the log management and analysis method in the above-mentioned embodiment.

[0165] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0166] The computer-readable storage medium may be included in the log management and analysis device; or may exist independently without being assembled into the log management and analysis device.

[0167] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the log management and analysis device, the log management and analysis device: collects log files of each node according to the log collector; stores the log files of each node to the search engine in a secure communication manner to obtain log data; retrieves the data to be processed from the log data according to the preset index statement in the search engine, and sends the data to be processed to the visualization analysis tool in an encrypted communication manner; monitors and analyzes the data to be processed based on the visualization analysis tool to obtain log management analysis results.

[0168] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0169] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0170] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0171] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned log management and analysis methods, and can solve the technical problems of log management and analysis. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the log management and analysis methods provided in the above-mentioned embodiments, and will not be elaborated here.

[0172] The present application also provides a computer program product, including a computer program, which implements the steps of the log management and analysis method as described above when executed by a processor.

[0173] The computer program product provided by this application can solve the technical problems of log management and analysis. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the log management and analysis method provided by the above embodiment, which will not be repeated here.

[0174] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A log management and analysis method, characterized in that: Applied to a log processing system, the log processing system includes a log collector, a search engine, and a visual analysis tool, the method includes: Collect the log files of each node through the log collector; Storing the log files of each node to the search engine in a secure communication manner to obtain log data; Retrieving the data to be processed from the log data according to a preset index statement in the search engine, and sending the data to be processed to the visual analysis tool in an encrypted communication manner; The data to be processed is monitored and analyzed based on the visual analysis tool to obtain log management analysis results.

2. The method according to claim 1, characterized in that The step of storing the log files of each node in the search engine in a secure communication manner to obtain log data also includes: Obtaining a cluster address of the search engine; Edit the security communication configuration file of the log collector according to the cluster address; The secure communication configuration file is started to construct a secure communication mode between the log collector and the search engine.

3. The method according to claim 1, characterized in that Before the step of retrieving the data to be processed from the log data according to the preset index statement in the search engine and sending the data to be processed to the visual analysis tool in an encrypted communication manner, the step further includes: Obtaining an encrypted communication configuration file between the search engine and the visual analysis tool; Setting encrypted communication conditions according to the encrypted communication configuration file and specifying actual use paths of the preset key store and trust store; An encrypted communication method between the search engine and the visual analysis tool is established based on the actual use path and the encrypted communication condition.

4. The method according to claim 1, characterized in that Before the step of retrieving the data to be processed from the log data according to the preset index statement in the search engine, the step further includes: Get log data management strategy; Configure log search logic according to the log data management strategy; An index statement for the log data is created in the search engine according to the log search logic.

5. The method according to claim 4, characterized in that The step of retrieving the data to be processed from the log data according to the preset index statement in the search engine comprises: Creating a corresponding index pattern in the visual analysis tool according to the index statement; The data to be processed is retrieved from the log data based on the index pattern.

6. The method according to claim 1, characterized in that The step of monitoring and analyzing the data to be processed based on the visual analysis tool to obtain the log management analysis result includes: Creating visualization charts and dashboards based on the visualization analysis function of the visualization analysis tool; Get preset alarm rules; The data to be processed is analyzed according to the visualization chart, the dashboard, and the preset alarm rules to obtain a log management analysis result.

7. The method according to claim 1, characterized in that After the step of analyzing the data to be processed based on the visual analysis tool to obtain the log management analysis result, the following step further includes: The search engine is integrated with a preset monitoring tool to comprehensively monitor the log data.

8. A log management and analysis device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the log management and analysis method according to any one of claims 1 to 7.

9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the log management and analysis method according to any one of claims 1 to 7 are implemented.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the log management and analysis method according to any one of claims 1 to 7 are implemented.