Log access method, device, equipment and storage medium for new system
Through connection with network attached storage and configuration of the agent, combined with the automated processing of basic log templates, the cumbersome log access process and high disk pressure are solved, and the simplified log access process and resource conservation is achieved.
Patent Information
- Application Number
- CN202010150629.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-03-05
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2040-03-05
AI Technical Summary
In the ELK+Filebeat centralized logging solution, large log volumes can easily lead to excessive disk pressure, and the log access process of the new system is cumbersome and requires a lot of manual operations.
By establishing a communication connection with network affiliated storage, installing an agent and setting a log storage path, reading a preset basic log template and updating its configuration items, receiving user template calls and submission instructions, parsing the template to obtain subsystem configuration information to create a log subsystem.
It simplifies manual operation content, avoids disk pressure caused by excessive log volume, optimizes the creation process of new log systems, and saves human resources.
Smart Images

Figure CN111475468B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer data processing technology, and in particular to a log access method, device, equipment and storage medium for a newly added system. Background Art
[0002] In the ELK+Filebeat centralized log solution, the installation of Filebeat and ELK is relatively simple. As a log collection client, filebeat has the characteristics of low power consumption compared to fluent written in Java. However, when the amount of logs is large, it is easy to occupy file handles and consume too much host disk, and even cause problems such as disk fullness.
[0003] In the traditional log access method, each instance has a different log path, and the instance IP address and subsystem name are also different. It is cumbersome to add a new agent (intelligent body) and configure a new log path for filebeat, which requires manual addition of agents and manual configuration of the log path of the new system. There are too many configuration files, and the management operation is very cumbersome, making management very time-consuming and labor-intensive. Summary of the invention
[0004] The technical problem to be solved by the embodiments of the present application is to provide a log access method, device, equipment and storage medium for a newly added system, optimize the creation process of a new system, avoid disk pressure caused by excessive log volume, and reduce manual operations when adding a new system.
[0005] In order to solve the above technical problems, a log access method for a newly added system described in an embodiment of the present application adopts the following technical solution:
[0006] A log access method for a newly added system includes:
[0007] Establishing a communication connection with the network attached storage;
[0008] Installing an agent for collecting logs, and setting a log storage path of the agent so that the log storage path is located in the network attached storage;
[0009] Reading a preset basic log template, configuring the log storage path in the configuration item of the basic log template as the log storage path of the agent, so as to update the basic log template, wherein the basic log template includes several configuration items for adding a new log subsystem;
[0010] receiving a template calling instruction from a target user, and sending the basic log template for the target user to fill in in response to the template calling instruction;
[0011] receiving a template submission instruction from a target user, and importing a basic log template filled in by the target user in response to the template submission instruction;
[0012] The basic log template is parsed to obtain subsystem basic configuration information, and a log subsystem is created according to the subsystem basic configuration information.
[0013] The log access method for the newly added system described in the embodiment of the present application simplifies a large amount of manual operation content by unifying the log storage path and configuration template, avoids disk pressure caused by excessive log volume, and optimizes the creation process of the new log system. There is no need to spend a lot of manual work to configure the information related to the new log system and implement the creation of the new log system, thereby effectively saving human resources.
[0014] Furthermore, in the log access method for the newly added system, before the step of reading the preset basic log template, the method further includes:
[0015] Read a pre-stored initial template or create a new initial template;
[0016] The initial template is configured to generate a basic log template, so that the configuration items of the basic log template at least include: subsystem name, subsystem type, subsystem IP address, subsystem log storage path and log storage format.
[0017] Furthermore, in the log access method for the newly added system, after the step of parsing the basic log template to obtain the subsystem basic configuration information, the method further includes:
[0018] A log subsystem query is performed according to the subsystem basic configuration information to detect whether there is a log subsystem matching the subsystem basic configuration information among the established log subsystems.
[0019] Furthermore, in the log access method for the newly added system, after the step of creating a log subsystem according to the subsystem basic configuration information, the method further includes:
[0020] Obtain the basic configuration items of the target log subsystem, which include: subsystem name, subsystem type and subsystem IP address;
[0021] Query whether there is a matching historical log subsystem according to the subsystem name;
[0022] After the historical log subsystem is found, check whether the basic configuration items of the historical log subsystem are the same as the subsystem type and the subsystem IP address.
[0023] Furthermore, in the log access method for the newly added system, after the step of creating a log subsystem according to the subsystem basic configuration information, the method further includes:
[0024] Read the set first time interval;
[0025] Performing log collection of the target subsystem within the first time interval;
[0026] The system identifier of the target subsystem is obtained, and the network attached storage is searched for a log file of the target subsystem according to the system identifier and the first time interval, so as to determine whether the target subsystem is successfully connected to the current server.
[0027] Furthermore, in the log access method for the newly added system, after the step of creating a log subsystem according to the subsystem basic configuration information, the method further includes:
[0028] Reading a preset second time interval;
[0029] Execute log collection of all log subsystems within the second time interval;
[0030] The amount of logs generated by each log subsystem in the second time interval is counted.
[0031] Furthermore, in the log access method for the newly added system, after the step of counting the amount of logs generated by each log subsystem in the second time interval, the method further includes:
[0032] Obtaining an alarm threshold corresponding to the second time interval, and detecting whether there is a log subsystem whose log volume is greater than the alarm threshold;
[0033] If it exists, it is recorded as a heavy-load subsystem, and a parallel subsystem is established for the corresponding heavy-load subsystem, so that the parallel subsystem bears the log collection work for the heavy-load subsystem.
[0034] In order to solve the above technical problems, the embodiment of the present application further provides a log access device for a new system, which adopts the following technical solution:
[0035] A log access device for a newly added system, comprising:
[0036] An attached communication module, used to establish a communication connection with the network attached storage;
[0037] A log configuration module, used to install an agent for collecting logs, and to set a log storage path of the agent so that the log storage path is located in the network attached storage;
[0038] A template update module, used to read a preset basic log template, configure the log storage path in the configuration item of the basic log template as the log storage path of the agent, so as to update the basic log template, wherein the basic log template includes several configuration items for adding a new log subsystem;
[0039] A template sending module, used for receiving a template calling instruction of a target user, and sending the basic log template for the target user to fill in in response to the template calling instruction;
[0040] A template receiving module, used for receiving a template submission instruction from a target user, and importing a basic log template filled in by the target user in response to the template submission instruction;
[0041] The system creation module is used to parse the basic log template to obtain subsystem basic configuration information, and create a log subsystem according to the subsystem basic configuration information.
[0042] The log access device of the newly added system described in the embodiment of the present application simplifies a large amount of manual operation content by unifying the log storage path and configuration template, avoids disk pressure caused by excessive log volume, and optimizes the creation process of the new log system. There is no need to spend a lot of manual work to configure the information related to the new log system and implement the creation of the new log system, thereby effectively saving human resources.
[0043] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:
[0044] A computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the log access method for a new system as described in any one of the above technical solutions are implemented.
[0045] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:
[0046] A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of the log access method for a new system as described in any one of the above technical solutions are implemented.
[0047] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0048] The embodiment of the present application discloses a log access method, device, equipment and storage medium for a newly added system. The log access method for the newly added system described in the embodiment of the present application first establishes a communication connection with a network-attached storage; then installs an intelligent agent for collecting logs, and sets the log storage path of the intelligent agent so that the log storage path is located in the network-attached storage; reads a basic log template, and configures the log storage path in the configuration item of the basic log template as the log storage path of the intelligent agent; then sends the basic log template for the target user to fill in; and after importing the basic log template filled in by the target user; parses the basic log template to obtain the basic configuration information of the subsystem, and finally creates a log subsystem according to the basic configuration information of the subsystem. The method simplifies a large amount of manual operation content by unifying the log storage path and configuration template, avoids the disk pressure caused by excessive log volume, optimizes the creation process of the new log system, and does not need to spend a lot of manual work to configure the information related to the new log system and implement the creation of the new log system, thereby effectively saving human resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0050] Figure 1 is an exemplary system architecture diagram to which the embodiments of the present application can be applied;
[0051] Figure 2 This is a flowchart of an embodiment of the log access method for the newly added system described in the embodiments of the present application;
[0052] Figure 3 This is a structural diagram of an embodiment of a log access device for a newly added system described in an embodiment of the present application;
[0053] Figure 4 It is a structural diagram of an embodiment of a computer device in the embodiments of the present application. DETAILED DESCRIPTION
[0054] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.
[0055] It should be noted that the terms "include", "comprises" and "have" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices. In the claims, specification and drawings of the present application, relational terms such as "first" and "second" are merely used to distinguish one entity / operation / object from another entity / operation / object, and do not necessarily require or imply any such actual relationship or order between these entities / operations / objects.
[0056] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0057] In order to enable those skilled in the art to better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the relevant drawings in the embodiments of the present application.
[0058] like Figure 1 As shown, the system architecture 100 may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0059] The user can use the first terminal device 101, the second terminal device 102 and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102 and the third terminal device 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0060] The first terminal device 101, the second terminal device 102 and the third terminal device 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 (Moving Picture Experts Group Audio Layer IV) players, laptop computers and desktop computers, etc.
[0061] The server 105 may be a server that provides various services, for example, a background server that provides support for pages displayed on the first terminal device 101 , the first terminal device 102 , and the third terminal device 103 .
[0062] It should be noted that the log access method of the newly added system provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the log access device of the newly added system is generally set in the server / terminal device.
[0063] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.
[0064] Continue to refer Figure 2 , shows a flow chart of an embodiment of the log access method of the newly added system in the embodiment of the present application. The log access method of the newly added system includes the following steps:
[0065] Step 201: Establish a communication connection with a network attached storage.
[0066] Network Attached Storage (NAS) is a terminal connected to the network with data storage function, also known as "network storage". In this application, after the current server is connected to the NAS, the log files of each subsystem connected to the current server can be stored through the storage space of the NAS.
[0067] Step 202: Install an agent for collecting logs, and set a log storage path for the agent so that the log storage path is located in the network attached storage.
[0068] An agent is a software or hardware entity that can act autonomously. Filebeat is a lightweight log collector. The agent in this application refers to the filebeat process used to collect logs.
[0069] For different instances that generate logs (such as several cloud servers connected to the current server), the log storage paths corresponding to the logs generated by each instance are different. Therefore, it is often necessary to install the agent once in the cloud server where each instance is located, and then set the log storage paths of the agents in different servers separately. Among them, different instances can be regarded as different subsystems.
[0070] In this application, after setting up the communication with the NAS, first install the agent once in the current server and configure the agent's log storage path to the NAS, so that the agent collects the logs and transfers them to the NAS for storage, so as to centrally store the log files generated by each subsystem, thereby avoiding multiple installations of the agent and consuming the disk resources of the current server.
[0071] Step 203: Read a preset basic log template, configure the log storage path in the configuration item of the basic log template as the log storage path of the agent to update the basic log template, wherein the basic log template includes several configuration items for adding a new log subsystem.
[0072] After the basic log template is provided to the target user, the target user configures the relevant settings of the newly added log subsystem that needs to be connected to the current server. The relevant settings refer to the configuration items for the newly added log subsystem.
[0073] In this application, for different cloud servers belonging to different instances, the log storage paths of the newly added log subsystems are standardized and unified, and all are set in nas. In this way, it is only necessary to install an agent once in the current server that has a communication connection with each instance, without installing an agent once in each subsystem. The logs generated in different subsystems can be collected and centralized through nas, thereby realizing unified collection of logs based on the standardized log storage path.
[0074] In some embodiments of the present application, before the step of reading the preset basic log template, the log access method of the newly added system further includes:
[0075] Read a pre-stored initial template or create a new initial template;
[0076] The initial template is configured to generate a basic log template, so that the configuration items of the basic log template at least include: subsystem name, subsystem type, subsystem IP address, subsystem log storage path and log storage format.
[0077] Specifically, the personalized configuration items in the basic log template may include: subsystem name, subsystem type, subsystem IP address and subsystem log storage path, and subsystem log format, etc. These personalized configuration items can be regarded as necessary basic configuration items when creating a new log subsystem.
[0078] Step 204: receiving a template calling instruction from a target user, and sending the basic log template to the target user for filling in in response to the template calling instruction.
[0079] When the target user manages logs, if there is a need to add a new log subsystem, a template call instruction will be sent to the current server to call out the basic log template, and then the parameter values of each configuration item in the basic log template can be filled in based on its needs.
[0080] The called basic log template is the basic log template updated by the operation in step 203, wherein the log storage path points to the storage location in the network attached storage.
[0081] Step 205: Receive a template submission instruction from a target user, and import the basic log template filled in by the target user in response to the template submission instruction.
[0082] After the target user has filled in the content in the basic log template, he submits the basic log template to the current server by sending a template submission instruction to the current server. After the current server completes the user authority review of the target user, it receives the basic log template filled in by the target user and imports it into the database.
[0083] In a specific implementation of the present application, the target user calls the basic log template, fills in the basic log template, and submits the basic log template. The operation process is all completed in the front-end user operation interface provided by the current server.
[0084] In the embodiment of the present application, the log access method of the newly added system is run on the electronic device (eg Figure 1 The server / terminal device shown in the figure) can receive the template call instruction and template submission instruction issued by the target user through a wired connection or a wireless connection. It should be noted that the above wireless connection method may include but is not limited to 3G / 4G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods currently known or to be developed in the future.
[0085] Step 206: Parse the basic log template to obtain subsystem basic configuration information, and create a log subsystem according to the subsystem basic configuration information.
[0086] After the current server imports the basic log template filled in by the target user, it can automatically establish the corresponding log subsystem according to the necessary subsystem configuration information (i.e., the basic subsystem configuration information) by parsing the basic log template to obtain the subsystem configuration information of the new log subsystem, and the newly established log subsystem is automatically associated with the nas based on the log storage path in the basic log template, so that the collected logs are uniformly collected by the nas. This effectively simplifies the content of manual operations, and there is no need to spend a lot of manual work to configure subsystem-related information and create subsystems.
[0087] In some embodiments of the present application, after the step of parsing the basic log template to obtain subsystem basic configuration information in step 206, the log access method of the newly added system further includes:
[0088] A log subsystem query is performed according to the subsystem basic configuration information to detect whether there is a log subsystem matching the subsystem basic configuration information among the established log subsystems.
[0089] By querying and verifying the subsystem basic configuration information of the log subsystem to be created, it is determined whether the log subsystem to be created already exists in the currently established log subsystem, thereby completing the duplicate check to avoid duplicate creation of subsystems and affecting the normal operation of the server.
[0090] In a specific implementation of the present application, after step 206, the log access method of the newly added system further includes:
[0091] Obtain the basic configuration items of the target log subsystem, which include: subsystem name, subsystem type and subsystem IP address;
[0092] Query whether there is a matching historical log subsystem according to the subsystem name;
[0093] After the historical log subsystem is found, check whether the basic configuration items of the historical log subsystem are the same as the subsystem type and the subsystem IP address.
[0094] After creating a log subsystem, if you want to further verify whether it has been created successfully, you can first obtain the basic configuration items of the target log subsystem you need to verify, and then query the database of the current server to see whether there is a historical log subsystem that matches the basic configuration items. If so, it means that it has been created successfully. If not, the creation has failed.
[0095] Specifically, the basic configuration items include: subsystem name, subsystem type and subsystem IP address. When matching according to the basic configuration items, the verification is performed in a manner of first matching the subsystem name, and then matching the subsystem type and subsystem IP address.
[0096] In some embodiments of the present application, after step 206, the log access method of the newly added system further includes:
[0097] Read the set first time interval;
[0098] Performing log collection of the target subsystem within the first time interval;
[0099] The system identifier of the target subsystem is obtained, and the network attached storage is searched for a log file of the target subsystem according to the system identifier and the first time interval, so as to determine whether the target subsystem is successfully connected to the current server.
[0100] If you want to check whether the newly created log subsystem is successfully connected to the NAS, you can make a judgment by detecting whether the corresponding log files are generated in the NAS after executing log collection.
[0101] Specifically, the first time interval is used as the query time period, and the log file in the NAS is searched in combination with the system identifier of the log subsystem. If the log content in the log file matches the system identifier and the first time interval, it means that the log subsystem corresponding to the system identifier has been successfully established and connected to the NAS. Otherwise, the NAS has not been successfully created or connected. At this time, an alarm message is generated to report an error.
[0102] In some embodiments of the present application, after step 206, the log access method of the newly added system further includes:
[0103] Reading a preset second time interval;
[0104] Execute log collection of all log subsystems within the second time interval;
[0105] The amount of logs generated by each log subsystem in the second time interval is counted.
[0106] If the log collection speed is too fast and the log transmission speed cannot keep up, the log resources will occupy a large amount of disk / memory resources in the current server, thereby affecting the normal operation and speed of the current server.
[0107] We further understand that after the agent collects logs, they need to be transmitted to the NAS. If the collection speed is much faster than the transmission speed, the normal transmission of logs will be blocked, and the logs will gradually accumulate and become unsalable in the current server. By counting the production of related logs, we can determine the probability of such abnormal conditions, and then further establish corresponding technical means to solve them.
[0108] In this embodiment, log collection is started after setting the second time interval, and the status of new log files added in the nas during the time period corresponding to the second time interval is detected to count the log volumes generated by each log subsystem during the second time interval.
[0109] In a further specific implementation, after step 206, the log access method of the newly added system further includes:
[0110] Obtaining an alarm threshold corresponding to the second time interval, and detecting whether there is a log subsystem whose log volume is greater than the alarm threshold;
[0111] If it exists, it is recorded as a heavy-load subsystem, and a parallel subsystem is established for the corresponding heavy-load subsystem, so that the parallel subsystem bears the log collection work for the heavy-load subsystem.
[0112] The log volume generated by each log subsystem is compared with the corresponding alarm threshold. If the log volume of a subsystem exceeds the corresponding alarm threshold in the second time interval, it is considered to have a greater risk of affecting disk performance and the subsystem is considered to be a heavy-load subsystem. A new log system can be established to work in parallel with the heavy-load subsystem to share the log transmission work previously completed by a single log system.
[0113] The log access method for the newly added system described in the embodiment of the present application simplifies a large amount of manual operation content by unifying the log storage path and configuration template, avoids disk pressure caused by excessive log volume, and optimizes the creation process of the new log system. There is no need to spend a lot of manual work to configure the information related to the new log system and implement the creation of the new log system, thereby effectively saving human resources.
[0114] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0115] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0116] Further references Figure 3 , Figure 3 A schematic diagram of the structure of an embodiment of a log access device for a newly added system in an embodiment of the present application is shown. Figure 2 The present application provides an embodiment of a log access device for a newly added system, and the device embodiment is similar to Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0117] like Figure 3 As shown, the log access device of the newly added system described in this embodiment includes:
[0118] The attached communication module 301 is used to establish a communication connection with the network attached storage.
[0119] The log configuration module 302 is used to install an agent for collecting logs and set the log storage path of the agent so that the log storage path is located in the network attached storage.
[0120] Template update module 303; used to read a preset basic log template, configure the log storage path in the configuration item of the basic log template as the log storage path of the agent, so as to update the basic log template, wherein the basic log template includes several configuration items for adding a new log subsystem;
[0121] The template sending module 304 is used to receive a template calling instruction from a target user, and send the basic log template for the target user to fill in in response to the template calling instruction.
[0122] Template receiving module 305; used to receive a template submission instruction from a target user, and import a basic log template filled in by the target user in response to the template submission instruction;
[0123] The system creation module 306 is used to parse the basic log template to obtain subsystem basic configuration information, and create a log subsystem according to the subsystem basic configuration information.
[0124] In some embodiments of the present application, the log access device of the newly added system also includes: a template generation module; before the template update module 303 reads the preset basic log template, the template generation module is used to read a pre-stored initial template or create a new initial template; the initial template is configured to generate a basic log template, so that the configuration items of the basic log template include at least: subsystem name, subsystem type, subsystem IP address, subsystem log storage path and log storage format.
[0125] In some embodiments of the present application, the log access device of the newly added system also includes: a system duplication checking module. After the system creation module 306 parses the basic log template to obtain the subsystem basic configuration information, the system duplication checking module is used to perform a log subsystem query according to the subsystem basic configuration information to detect whether there is a log subsystem matching the subsystem basic configuration information in the established log subsystem.
[0126] In a specific implementation of the present application, the log access device of the newly added system also includes: a first system inspection module. After the system creation module 306 creates the log subsystem according to the subsystem basic configuration information, the first system inspection module is used to obtain the basic configuration items of the target log subsystem, and the basic configuration items include: subsystem name, subsystem type and subsystem IP address; query whether there is a matching historical log subsystem according to the subsystem name; after querying the historical log subsystem, check whether the basic configuration items of the historical log subsystem are the same as the subsystem type and the subsystem IP address.
[0127] In some embodiments of the present application, the log access device of the newly added system further includes: a second system verification module. After the system creation module 306 creates the log subsystem according to the subsystem basic configuration information, the second system verification module is used to read the set first time interval; perform log collection of the target subsystem within the first time interval; obtain the system identifier of the target subsystem, and search the network attached storage for the log file of the target subsystem according to the system identifier and the first time interval to determine whether the target subsystem is successfully connected to the current server.
[0128] In some embodiments of the present application, the log access device of the newly added system further includes: a log collection module. After the system creation module 306 creates the log subsystem according to the subsystem basic configuration information, the log collection module is used to read a preset second time interval; perform log collection of all log subsystems within the second time interval; and count the amount of logs generated by each log subsystem within the second time interval.
[0129] In a further specific implementation, the log collection module is also used to obtain the alarm threshold corresponding to the second time interval, and detect whether there is a log subsystem whose log volume is greater than the alarm threshold; if so, it is recorded as a heavy-load subsystem, and a parallel subsystem is established for the corresponding heavy-load subsystem through the system creation module 306, so that the parallel subsystem can bear the log collection work for the heavy-load subsystem.
[0130] The log access device of the newly added system described in the embodiment of the present application simplifies a large amount of manual operation content by unifying the log storage path and configuration template, avoids disk pressure caused by excessive log volume, and optimizes the creation process of the new log system. There is no need to spend a lot of manual work to configure the information related to the new log system and implement the creation of the new log system, thereby effectively saving human resources.
[0131] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.
[0132] The computer device 6 includes a memory 61, a processor 62, and a network interface 63 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 6 with components 61-63, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), digital processors (DSP), embedded devices, etc.
[0133] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0134] The memory 61 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 61 can be an internal storage unit of the computer device 6, such as a hard disk or memory of the computer device 6. In other embodiments, the memory 61 can also be an external storage device of the computer device 6, such as a plug-in hard disk equipped on the computer device 6, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. Of course, the memory 61 can also include both the internal storage unit of the computer device 6 and its external storage device. In this embodiment, the memory 61 is generally used to store the operating system and various application software installed on the computer device 6, such as the program code of the log access method of the newly added system. In addition, the memory 61 can also be used to temporarily store various types of data that have been output or are to be output.
[0135] The processor 62 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 62 is generally used to control the overall operation of the computer device 6. In this embodiment, the processor 62 is used to run the program code stored in the memory 61 or process data, such as running the program code of the log access method of the newly added system.
[0136] The network interface 63 may include a wireless network interface or a wired network interface. The network interface 63 is generally used to establish a communication connection between the computer device 6 and other electronic devices.
[0137] The present application also provides another implementation mode, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores a log access program for a newly added system, and the log access program for the newly added system can be executed by at least one processor so that the at least one processor performs the steps of the log access method for the newly added system as described above.
[0138] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0139] In the above embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation, for example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0140] The modules or components may or may not be physically separated, and the parts displayed as modules or components may or may not be physical modules, and may be located in one place or distributed on multiple network units. Some or all of the modules or components may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0141] The present application is not limited to the above-mentioned implementation modes. The above-mentioned are the preferred implementation modes of the present application. The examples are only used to illustrate the present application and are not used to limit the scope of the present application. It should be pointed out that, for ordinary technicians in the technical field, without departing from the principle of the present application, they can still make some improvements and modifications to the technical solutions recorded in the above-mentioned specific implementation modes, or make equivalent replacements for some of the technical features therein. Any equivalent structure made by using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, shall be deemed to be included in the protection scope of the present application.
[0142] Obviously, the embodiments described above are only part of the embodiments of the present application, rather than all the embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work, as well as all equivalent structures made using the contents of the present application specification and the accompanying drawings, directly or indirectly used in other related technical fields, are similarly within the scope of patent protection of the present application.
Claims
1. A log access method for a newly added system, characterized in that: include: Establishing a communication connection with the network attached storage; Installing an agent for collecting logs, and setting a log storage path of the agent so that the log storage path is located in the network attached storage; Reading a preset basic log template, configuring the log storage path in the configuration item of the basic log template as the log storage path of the agent, so as to update the basic log template, wherein the basic log template includes a plurality of configuration items for adding a new log subsystem, and the basic log template is used to provide the target user with the target user to configure the relevant settings of the new log subsystem to be connected to the current server, wherein the relevant settings refer to the configuration items for adding the new log subsystem; receiving a template calling instruction from a target user, and sending the basic log template for the target user to fill in in response to the template calling instruction; receiving a template submission instruction from a target user, and importing a basic log template filled in by the target user in response to the template submission instruction; The basic log template is parsed to obtain the basic configuration information of the subsystem, and a log subsystem is created according to the basic configuration information of the subsystem. The log subsystem is automatically associated and connected to the intelligent agent based on the log storage path in the basic log template, so that the collected logs are uniformly collected by the intelligent agent.
2. The log access method for a newly added system according to claim 1, characterized in that: Before the step of reading the preset basic log template, the method further includes: Read a pre-stored initial template or create a new initial template; The initial template is configured to generate a basic log template, so that the configuration items of the basic log template at least include: subsystem name, subsystem type, subsystem IP address, subsystem log storage path and log storage format.
3. The log access method for a newly added system according to claim 1, characterized in that: After the step of parsing the basic log template to obtain subsystem basic configuration information, the method further includes: A log subsystem query is performed according to the subsystem basic configuration information to detect whether there is a log subsystem matching the subsystem basic configuration information among the established log subsystems.
4. The log access method for a newly added system according to claim 1, characterized in that: After the step of creating a log subsystem according to the subsystem basic configuration information, the method further includes: Obtain the basic configuration items of the target log subsystem, which include: subsystem name, subsystem type and subsystem IP address; Query whether there is a matching historical log subsystem according to the subsystem name; After the historical log subsystem is found, check whether the basic configuration items of the historical log subsystem are the same as the subsystem type and the subsystem IP address.
5. The log access method for a newly added system according to claim 1, characterized in that: After the step of creating a log subsystem according to the subsystem basic configuration information, the method further includes: Read the set first time interval; Performing log collection of the target subsystem within the first time interval; The system identifier of the target subsystem is obtained, and the network attached storage is searched for a log file of the target subsystem according to the system identifier and the first time interval, so as to determine whether the target subsystem is successfully connected to the current server.
6. The log access method for a newly added system according to claim 1, characterized in that: After the step of creating a log subsystem according to the subsystem basic configuration information, the method further includes: Reading a preset second time interval; Execute log collection of all log subsystems within the second time interval; The amount of logs generated by each log subsystem in the second time interval is counted.
7. The log access method for a newly added system according to claim 6, characterized in that: After the step of counting the amount of logs generated by each log subsystem in the second time interval, the method further includes: Obtaining an alarm threshold corresponding to the second time interval, and detecting whether there is a log subsystem whose log volume is greater than the alarm threshold; If it exists, it is recorded as a heavy-load subsystem, and a parallel subsystem is established for the corresponding heavy-load subsystem, so that the parallel subsystem bears the log collection work for the heavy-load subsystem.
8. A log access device for a newly added system, characterized in that: include: An attached communication module, used to establish a communication connection with the network attached storage; A log configuration module, used to install an agent for collecting logs, and to set a log storage path of the agent so that the log storage path is located in the network attached storage; A template update module is used to read a preset basic log template, configure the log storage path in the configuration item of the basic log template as the log storage path of the agent, so as to update the basic log template, wherein the basic log template includes a plurality of configuration items for adding a new log subsystem, and the basic log template is used to provide the target user with the target user to configure the relevant settings of the new log subsystem to be connected to the current server, wherein the relevant settings refer to the configuration items for the new log subsystem; A template sending module, used for receiving a template calling instruction of a target user, and sending the basic log template for the target user to fill in in response to the template calling instruction; A template receiving module, used for receiving a template submission instruction from a target user, and importing a basic log template filled in by the target user in response to the template submission instruction; The system creation module is used to parse the basic log template to obtain the basic configuration information of the subsystem, and create a log subsystem according to the basic configuration information of the subsystem. The log subsystem automatically associates and connects to the intelligent agent based on the log storage path in the basic log template, so that the collected logs are uniformly collected by the intelligent agent.
9. A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the log access method for a new system as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the log access method for a new system as described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Log management system and log collection method
CN105099740A
Method, device and system for log dynamic configuration
CN106802858A