Log collector management and control method, platform, electronic device and storage medium

Through the intelligent configuration and management of the log collector's control platform, the problem of inefficiency in manually configuring log collection tasks is solved, and efficient log collection task configuration and management are achieved. It is suitable for large-scale log collection scenarios, improves configuration efficiency and enhances security.

CN110727557BActive Publication Date: 2025-10-03BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201910899808.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-09-23
Publication Date
2025-10-03
Estimated Expiration
2039-09-23

AI Technical Summary

Technical Problem

In the existing log collection process, manual configuration of log collection tasks is inefficient and difficult to adapt to the intelligent management and control requirements of large-scale log collection scenarios.

Method used

The registration request is received through the log collector's management and control platform, and the configuration file and configuration version number are configured. The configuration file is generated based on the task ID and version number, and automatically deployed and transmitted online. The correspondence between the host ID, task ID and version number is established and stored in the database relational table and cache to achieve intelligent management.

Benefits of technology

It improves the configuration efficiency of log collection tasks, is suitable for large-scale log collection scenarios, implements automatic online deployment and transmission, enhances management efficiency and security, and provides visual operation indicator display and alarm functions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110727557B_ABST
    Figure CN110727557B_ABST
Patent Text Reader

Abstract

The present application discloses a management and control method, platform, electronic device and storage medium for a log collector, and relates to the field of big data. The specific implementation scheme is: receiving a registration request sent by a log collector; carrying identification information of the host where the log collector is located in the request; configuring a corresponding configuration file and configuration version number for the log collector; the configuration file includes identification information of the task configured for the log collector; the configuration version number is used to identify the number of updates of the task configured for the log collector; sending the configuration file and configuration version number to the corresponding log collector, so that the log collector can load the task configuration file to perform the corresponding task. The present application adopts the above scheme, which can overcome the problem of low efficiency of manually configuring log tasks in the prior art, and can then automatically deploy and transmit log collection tasks online intelligently, can be applied to large-scale log collection scenarios, and effectively improve the configuration efficiency of log collection tasks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer application technology, in particular to big data technology, and specifically to a management and control method, platform, electronic device, and storage medium for a log collector. Background Art

[0002] Log collection is primarily used to collect log information generated by various systems or applications. Log information typically includes operating status, indicators, and various user information. The rich content can help analyze the corresponding system or application. Therefore, log collection is a very important task.

[0003] The existing log collection process involves deploying a log collector. Typically, users manually deploy the log collector and modify its configuration file to collect and transmit log data. However, with the massive growth of business logs, the need for intelligent management and control of the collection and transmission of massive logs is becoming increasingly urgent. Manually configuring log collection tasks is inefficient and difficult to implement. Summary of the Invention

[0004] The present invention provides a log collector management and control method, platform, electronic device and storage medium for intelligently configuring log collection tasks for the log collector and improving the configuration efficiency of log collection.

[0005] This application provides a log collector management and control method, the method comprising:

[0006] Receive a registration request sent by a log collector; the registration request carries identification information of the host where the log collector is located;

[0007] A configuration file and a configuration version number are configured for the log collector; the configuration file includes identification information of the task configured for the log collector; the configuration version number is used to identify the number of updates of the task configured for the log collector;

[0008] The configuration file and the configuration version number are sent to the corresponding log collector, so that the log collector can load the configuration file to perform the corresponding task.

[0009] Further optionally, in the above method, configuring a corresponding configuration file and configuration version number for the log collector includes:

[0010] Configure the task identifier and the corresponding task version number for the log collector;

[0011] Generate the corresponding configuration file based on the task identifier and the corresponding task version number configured for the log collector;

[0012] Configure the configuration version number of the log collector.

[0013] Further optionally, in the above method, after configuring the corresponding configuration file and configuration version number for the log collector, the method further includes:

[0014] Establishing a correspondence between the host identification information, the task identification, and the task version number; and storing the correspondence in a database relation table; and / or

[0015] The identification information of the host and the corresponding configuration file are stored in a cache.

[0016] Further optionally, in the above method, after configuring the corresponding configuration file and configuration version number for the log collector, the method further includes:

[0017] According to the task update requirements, update the task identifier and the corresponding task version number;

[0018] Based on the updated task identifier and the corresponding task version number, updating the configuration file and the configuration version number corresponding to the log collector that needs to execute the updated task;

[0019] The corresponding relationship corresponding to the log collector that needs to execute the updated task in the database relationship table and / or the corresponding configuration file in the cache are updated.

[0020] Further optionally, in the above method, after sending the configuration file and the configuration version number to the corresponding log collector, the method further includes:

[0021] Receive a heartbeat message sent by the log collector according to a preset period, wherein the heartbeat message carries the identification information of the host and the configuration version number;

[0022] Obtaining the locally recorded configuration version number according to the identification information of the host;

[0023] Detect whether the configuration version number recorded locally is consistent with the configuration version number carried in the heartbeat message;

[0024] If they are inconsistent, obtaining the corresponding updated configuration file from the cache according to the identification information of the host;

[0025] The updated configuration file and the locally recorded configuration version number are sent to the corresponding log collector, so that the log collector can load the updated configuration file to execute the corresponding task.

[0026] Further optionally, in the above method, the heartbeat message also carries the running indicators of each task and / or the running indicators of the log collector process; the method further includes:

[0027] Drawing visual indicator dynamic information based on the running indicators of each task and / or the running indicators of the process in the heartbeat messages of the log collector for multiple times; displaying the visual indicator dynamic information; and / or

[0028] According to the operation index of each task and / or the operation index of the process in the log collector and the preset alarm conditions, it is determined whether an alarm needs to be triggered; if necessary, an alarm is issued according to the preset alarm method.

[0029] Further optionally, in the above method, after sending the configuration file and the configuration version number to the corresponding log collector, the method further includes:

[0030] If the heartbeat message sent by the log collector is not received within a preset time length, a restart prompt message is sent to prompt the user to restart the log collector.

[0031] This application also provides a log collector management and control platform, which includes:

[0032] A receiving module, configured to receive a registration request sent by a log collector; the registration request carries identification information of the host where the log collector is located;

[0033] A configuration module, configured to configure a configuration file and a configuration version number for the log collector; the configuration file includes identification information of the task configured for the log collector; the configuration version number is used to identify the number of updates of the task configured for the log collector;

[0034] The sending module is used to send the configuration file and the configuration version number to the corresponding log collector, so that the log collector can load the configuration file to perform the corresponding task.

[0035] The present application also provides an electronic device, comprising:

[0036] at least one processor; and

[0037] a memory communicatively connected to the at least one processor; wherein,

[0038] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to perform any of the above methods.

[0039] The present application also provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute any of the above methods.

[0040] This application also provides a log collector management and control method, the method comprising:

[0041] Receive a registration request sent by a log collector; the registration request carries identification information of the host where the log collector is located and identification information of the task;

[0042] Configuring a configuration file for the log collector according to the identification information of the task;

[0043] The configuration file is sent to the corresponding log collector so that the log collector loads the configuration file to perform the corresponding task.

[0044] One embodiment of the above application has the following advantages or beneficial effects: through the management and control platform of the log collector, log collection tasks can be intelligently configured for each registered log collector, and the configuration file and configuration version number can be transmitted to the corresponding log collector so that the log collector can load the configuration file to perform the corresponding task, overcoming the problem of low efficiency of manually configuring log tasks in the prior art, and then being able to intelligently and automatically deploy and transmit log collection tasks online, which can be applicable to large-scale log collection scenarios and effectively improve the configuration efficiency of log collection tasks. According to the technical solution of the embodiment of the present application, the problem of low efficiency of manually configuring log collection tasks in the prior art is overcome. In the present application, by intelligently and automatically deploying and transmitting log collection tasks online, it can be applicable to large-scale log collection scenarios and effectively improve the configuration efficiency of log collection tasks.

[0045] Furthermore, the technical solution of the embodiments of the present application can establish a correspondence between the host's identification information, the task identifier, and the task version number; and store this correspondence in a database relational table, thereby facilitating centralized management of the log collector and the tasks it executes, and facilitating subsequent query and use. Furthermore, in the above embodiments, the host's identification information and the corresponding configuration file can also be stored in a cache, so that when the configuration file needs to be sent to the log collector later, it can be obtained in a timely manner, thereby improving the efficiency of log configuration file delivery.

[0046] Furthermore, the technical solution of the embodiment of the present application can also update the configuration file corresponding to the task identifier and the corresponding task version number according to the task update requirements; and based on the updated task identifier and the corresponding task version number, update the configuration file and configuration version number corresponding to the log collector that needs to execute the updated task, so that all relevant information can be updated in time for the newly updated task, facilitating subsequent accurate use.

[0047] Furthermore, the technical solution of the embodiment of the present application can also detect whether an updated configuration file needs to be sent to the log collector based on the heartbeat message of the log collector, and send it when necessary, thereby ensuring that all updated configuration files can be sent to the log collector in a timely and accurate manner.

[0048] Furthermore, the technical solutions of the embodiments of this application can also provide dynamic visualization of the operating indicators of each task and / or process of the log collector, visually displaying all operating indicators, effectively enhancing the user experience. Moreover, in the above embodiments, an alarm can be issued when certain operating indicators reach preset alarm conditions, effectively improving user safety.

[0049] Furthermore, the technical solution of the embodiment of the present application can also prompt to restart the log collector if the heartbeat message sent by the log collector is not received within a preset time length, so that the log collector can be restarted in time when a problem occurs in the log collector, which greatly improves the management efficiency of the log collector.

[0050] Other effects of the above optional manner will be described below in conjunction with specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present application.

[0052] Figure 1 It is a schematic diagram according to the first embodiment of the present application.

[0053] Figure 2 This is an application architecture diagram of the log collector control method of this embodiment.

[0054] Figure 3 It is a schematic diagram according to the second embodiment of the present application.

[0055] Figure 4 It is a schematic diagram according to the third embodiment of the present application.

[0056] Figure 5 This is a block diagram of an electronic device used to implement the method for controlling the log collector of an embodiment of the present application. DETAILED DESCRIPTION

[0057] The following description of exemplary embodiments of the present application is made in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0058] Figure 1 This is a schematic diagram of the first embodiment of the present application, which describes in detail the process of the first embodiment of the log collector control method. Figure 1 As shown, the log collector management and control method of this embodiment may specifically include the following steps:

[0059] S101. Receive a registration request sent by a log collector; the registration request carries identification information of the host where the log collector is located;

[0060] The log collector management and control method of this embodiment is implemented by the log collector's management and control platform. This platform is used to intelligently manage and control the log collector, such as automatically and intelligently sending configuration files for log collection tasks to the log collector. The log collector management and control platform of this embodiment can be a standalone electronic device or a software-integrated application capable of managing and controlling log collectors distributed across various hosts.

[0061] In this embodiment, the log collector is specifically applied on the host, and each host can run a log collector. In this embodiment, the management of the log collector can be managed based on the user dimension. For example, Figure 2 This is an application architecture diagram of the log collector control method of this embodiment. Figure 2 As shown, the management and control platform of the log collector can maintain all log collectors of multiple users such as user 1, user 2, ... user m. In this embodiment, it is taken as an example that one user can maintain multiple log collectors n. Each log collector maintained by each user runs on a host. The application architecture is as follows Figure 2 The architecture is shown in Figure 1.

[0062] In this embodiment, the log collector can be installed offline. For example, a user can configure the log collector's installation command on the log collector's control platform. The user can then manually copy the log collector's installation command configured on the log collector's control platform to each of the multiple hosts they maintain, paste and run the installation command on each host, and thus install the log collector on each host. Optionally, in this embodiment, the installation command configured for each host of the same user can also include a token field, which is used to enable the log collector's control platform to authenticate each of the user's log collectors.

[0063] After a log collector is installed on each host maintained by the same user, each log collector can send a registration request to the log collector's management and control platform. This registration request also includes the host identification information for the log collector. In this embodiment, the host identification information can be at least one of the host's IP address, host ID, and host name. In other words, in this embodiment, the host's identification information is used to identify the log collector running on that host.

[0064] After receiving the registration request, the management and control platform of the log collector can know from which host the log collector sends the registration request based on the host identification information in the registration request.

[0065] Optionally, after receiving the registration request from each log collector, the log collector management and control platform can persistently store the host identification information in each registration request in a user information database to enable unified management and control of the log collectors on each host. Specifically, the storage format in the user information database can be user ID, identification information of the host corresponding to the user, etc.

[0066] Optionally, the registration request for the log collector of this embodiment may also include a token field. Accordingly, after receiving the registration request, the log collector's management and control platform verifies whether the token field configured for the user is consistent with the token field in the registration request sent by the log collector on the host maintained by the user. If they are consistent, authentication is successful, and the configuration file can be sent to the log collector subsequently. Otherwise, if they are inconsistent, authentication is unsuccessful. In this case, it can be assumed that the host has been used illegally and the token field has been tampered with; or the user has mistakenly deleted the token field, resulting in authentication failure.

[0067] It should be noted that in addition to storing the user ID and the identification information of the host corresponding to the user, the user information database also needs to store the token field corresponding to the user. Each user can maintain multiple hosts, and the identification information of the host corresponding to the same user can be multiple.

[0068] S102, configuring a configuration file and a configuration version number for the log collector; the configuration file includes identification information of the task configured for the log collector; the configuration version number is used to identify the update count of the task configured for the log collector;

[0069] In this embodiment, if the same task has only one version, the task identification information may only include the task identifier. If the same task has different versions, the task identification information may include the task identifier and the task version number.

[0070] For example, when the task identification information includes a task identifier and a task version number, the specific implementation of this step may include: configuring a task identifier and a corresponding task version number for the log collector; and generating a corresponding configuration file based on the task identifier and the corresponding task version number configured for the log collector. In other words, the configuration file includes the task identifier and the corresponding task version number for each task that the log collector needs to execute. Furthermore, to ensure the normal execution of the collection tasks, the configuration file may also include parameter information for each task to define the conditions, method, and other information for task execution. In this embodiment, each time a task is configured for the log collector, the configuration version number of the log collector is also configured. For example, the configVersion field can be used to identify the number of tasks configured for the log collector that have been updated. The initial value of the configuration version number is equal to the number of tasks configured when the configuration file is first configured for the corresponding log collector. Thereafter, the configuration version number is incremented by 1 each time a task in the configuration file is updated. For example, if N tasks are added to a log collector in batches, the configVerison of the log collector will be increased by N; if M tasks are deleted in batches, the configVersion of the log collector will be increased by M. In this embodiment, it is necessary to store the configuration version number of each log collector on the management and control platform of the log collector, and update the stored configuration version number in a timely manner each time the configuration version number is updated. When storing, the corresponding relationship between the host's identification information and the configuration version number can be stored to identify the configuration version number corresponding to the log collector corresponding to the host's identification information. Optionally, the corresponding relationship can also be stored in the user information database, and under the identification information of each host maintained by each user, the configuration version number of the log collector running on the host is recorded. In short, it is sufficient to record the host's identification information and the corresponding configuration version number on the management and control platform of the log collector.

[0071] When the identification information of the task only includes the task identification, all task version numbers can be removed, and the rest can be referred to the description of the above embodiment, which is more simple to implement.

[0072] In this embodiment, a visual interface can be provided on the log collector's control platform, allowing users to configure task information through the visual interface. That is, the log collector's control platform can receive configuration task information input by the user through the human-machine interface module to configure the task information for the log collector, or it can send the configuration task information to the log collector's control platform by sending a request. For example, in this embodiment, the configuration task information can include a task identifier and a task version number for each log collector, as well as the task name and other notes. The task identifier can be used to uniquely identify a task and can be any one or a combination of Chinese characters, numbers, and letters. The task version number is used to indicate the number of times the same task has been updated by adding or modifying operations. Each time a task is updated, the corresponding task version number needs to be updated. In this embodiment, the corresponding task version number is incremented by 1 each time a task is updated. In actual applications, other methods can also be used to indicate that a task has been updated. Furthermore, each time a task is updated, the configuration file of the corresponding log collector that needs to execute the updated task also needs to be updated.

[0073] Based on the task identifier and task version number identifier configured for each log collector in the above embodiment, a configuration file for each log collector can be generated. The configuration file is used to limit the information of the log collector to execute the collection task, such as which logs meet the parameters in the task corresponding to each task identifier and task version number, the storage format of the collected logs, the address to which the collected logs are sent, etc.

[0074] Optionally, in this embodiment, after configuring the configuration file and the configuration version number for the log collector in step S102, it can also include: establishing a correspondence between the host's identification information, the task identification, and the task version number; and storing the correspondence in a database relationship table; and / or storing the host's identification information and the corresponding configuration file in a cache.

[0075] In this embodiment, the log collector's management and control platform also maintains a database table that stores the corresponding host identification information, task identification, and task version number. Furthermore, each host's identification information and corresponding configuration file can be stored in a cache. This allows the log collector's configuration file to be retrieved from the cache based on the host's identification information when a configuration file is needed.

[0076] It should be noted that, in this embodiment, although the same task has multiple task version numbers, when configuring tasks for the log collectors of each host, it is not necessary to configure the latest task. You can choose to configure a task corresponding to any task version number for each log collector and establish a corresponding correspondence.

[0077] Optionally, in this embodiment, the log collectors can also be grouped, and the same configuration task can be configured for multiple log collectors in each group. Correspondingly, the received registration request includes registration requests for multiple log collectors. At this time, the log collector is configured with a configuration file and a configuration version number, which can be specifically manifested as: grouping the multiple log collectors that received the registration request; then configuring a task identifier and a corresponding task version number for each group, thereby configuring a task identifier and a corresponding task version number for each log collector. Of course, in this embodiment, it is also necessary to configure a group identifier for each group of log collectors; correspondingly, a correspondence between the group identifier and the corresponding log collector's host identification information can be established and stored in another database relational table. At this time, correspondingly, in the previous database relational table, the group identifier, task identifier and task version number can be stored according to the corresponding relationship to identify that the log collector groups with the same group identifier correspond to the same task version number of the same task.

[0078] S103: Send the configuration file and the configuration version number to the corresponding log collector, so that the log collector can load the configuration file to execute the corresponding task.

[0079] At the same time, the log collector needs to store the configuration version number for use in sending heartbeat messages to the log collector's management and control platform.

[0080] In this embodiment, whether each log collector is configured with an independent log collection task, or the log collectors are grouped and each group of log collectors is configured with the same log collection task, each log collector can be configured with a task identifier, a corresponding task version number, and a corresponding configuration version number. The configuration file and configuration version number are then sent to the corresponding log collector, which stores the corresponding configuration version number and loads the corresponding configuration file to execute the log collection task specified in the configuration file.

[0081] When the log collectors are grouped and the same log collection task is configured for each group, the same configuration file and configuration version number can be sent to each log collector in the group in the same manner.

[0082] Further optionally, in this embodiment, when the user configures task information on the management and control platform of the log collector, the task information visually configured by the user through the management and control platform can be converted into a string in the configuration file format of the log collector and stored in the cache as the configuration file of the corresponding log collector.

[0083] The log collector management and control method of this embodiment, in accordance with the above-mentioned manner, can intelligently configure log collection tasks for each registered log collector through the log collector management and control platform, and transmit a configuration file and configuration version number to the corresponding log collector so that the log collector can load the configuration file to perform the corresponding task. This overcomes the problem of low efficiency of manual configuration of log collection tasks in the prior art. In this embodiment, by intelligently and automatically deploying and transmitting log collection tasks online, it can be applied to large-scale log collection scenarios and effectively improve the configuration efficiency of log collection tasks.

[0084] Further optionally, after configuring the configuration file and the configuration version number for the log collector in step S102 of the above embodiment, the following steps may be further included:

[0085] (a1) Update the task identifier and the corresponding task version number according to the task update requirements;

[0086] (b1) establishing a correspondence between the task identifier, the updated task version number, and the identification information of the host where the log collector that needs to execute the updated configuration file is located, and storing the correspondence in a database relationship table; and / or updating the configuration file corresponding to the task identifier and the updated task version number in the cache.

[0087] The log collection task in this embodiment is not static. For example, driven by R&D needs, when it is necessary to collect log data under new parameters, or when it is not necessary to collect log data, the log collection task can be updated. The staff configures the task update requirements. Specifically, the corresponding task identifier needs to be identified in the task update requirements and input into the log collector's management and control platform through the human-machine interface module. At this time, the log collector's management and control platform can update the task identifier and the corresponding task version number according to the task update requirements; and based on the updated task identifier and the corresponding task version number, update the configuration file and configuration version number corresponding to the log collector that needs to execute the updated task. The update here includes adding tasks, deleting tasks, and modifying tasks, etc. For adding tasks and modifying tasks, updating the corresponding task version number can be achieved by accumulating 1. Since the task is updated, some log collectors must need to execute the updated configuration task. At this time, it is also necessary to determine which log collectors need to execute the updated task based on the user's configuration, and update the configuration file and configuration version number corresponding to the log collector that needs to execute the updated task accordingly. This also includes deleting tasks corresponding to certain task identifiers, which can be equivalent to leaving the task empty. This also requires updating the configuration files of the log collectors that execute the tasks. Furthermore, it is also necessary to update the corresponding relationships stored in the database relationship table corresponding to the log collectors that need to execute the updated tasks, and / or the corresponding configuration files in the cache. However, at this point, the corresponding configuration files have not yet been sent to the corresponding log collectors.

[0088] Figure 3 This is a schematic diagram of the second embodiment of the present application, which describes in detail the process of another embodiment of the log collector control method. Figure 3 As shown, the log collector control method of this embodiment is as follows: Figure 1 After step S103 of the illustrated embodiment sends the task identifier, configuration file, and task version number to the corresponding log collector, the following steps may be specifically included:

[0089] S301: Receive a heartbeat message sent by a log collector according to a preset period, where the heartbeat message carries the host's identification information and configuration version number;

[0090] Optionally, in this embodiment, the heartbeat message may further carry a task identifier of the task being executed by the log collector, or may further carry information such as a version number of the task.

[0091] It should be noted that if the log collector executes multiple tasks simultaneously, the heartbeat message can carry the task identifier and corresponding task version number of each of the multiple tasks.

[0092] In this embodiment, the period for each log collector to send a heartbeat message to the management and control platform of the log collector may be once per minute, or may be set to other durations according to actual needs.

[0093] S302. Obtain the locally recorded configuration version number based on the host's identification information;

[0094] For example, the corresponding relationship between the host identification information and the corresponding configuration version number is recorded locally on the management and control platform of the log collector. According to the host identification information, the locally recorded configuration version number can be obtained.

[0095] S303. Check whether the locally recorded configuration version number is consistent with the configuration version number carried in the heartbeat message; if not, execute step S304; otherwise, if consistent, do not perform any operation for the time being and end.

[0096] Because the log collector's management and control platform does not promptly deliver the task configuration file after updating the task based on task update requirements, after receiving the heartbeat message, it can check whether the configuration version number recorded locally by the same log collector is consistent with the configuration version number carried in the heartbeat message. If they are consistent, it means that the task does not need to be updated in the log collector, and no operation can be performed at this time. If they are inconsistent, it means that the task in the log collector needs to be updated.

[0097] S304. Obtain the corresponding updated configuration file from the cache according to the host identification information; execute step S305;

[0098] Optionally, if the configuration file recorded in the cache is invalid, it is also possible to obtain all task identifiers and corresponding task version numbers corresponding to the identification information of the host of the log collector from the database relationship table based on the identification information of the host, and then regenerate the configuration file of the log collector based on the identifiers and corresponding task version numbers of all tasks corresponding to the identification information of the host.

[0099] S305: Send the updated configuration file and the locally recorded configuration version number to the corresponding log collector, so that the log collector can load the updated configuration file and execute the corresponding task. In this embodiment, after receiving the heartbeat message from the log collector, if it is detected that the log collector has a configuration file that needs to be updated, the corresponding configuration file is retrieved from the cache and sent to the log collector along with the corresponding local configuration version number. The log collector stores the configuration version number for use the next time it sends a heartbeat message. Simultaneously, the updated configuration file is loaded to execute the corresponding updated task.

[0100] Similarly, optionally, after step S304 and before step S305, if the format of the configuration file configured by the management and control platform of the log collector cannot be run on the log collector, the format of the configuration file needs to be converted into a format that can be run on the log collector.

[0101] Optionally, the heartbeat message of this embodiment also carries the operating indicators of each task and / or the operating indicators of the log collector process; for example, the operating indicators of each task may include the number of bytes transmitted, error information, etc. The operating indicators of the log collector process may include CPU usage, memory usage, etc. In this case, the corresponding log collector management and control method may also perform any of the following operations based on the operating indicators in the heartbeat message:

[0102] (a2) drawing visual indicator dynamic information based on the running indicators of each task and / or process in the log collector's multiple consecutive heartbeat messages; displaying the visual indicator dynamic information; and / or

[0103] (b2) judging whether an alarm needs to be triggered based on the operating indicators of each task and / or process in the log collector and the preset alarm conditions; if necessary, issuing an alarm according to the preset alarm method.

[0104] In this embodiment, each log collector is configured to send a heartbeat message to its management and control platform at a preset interval, such as once per minute. Accordingly, the management and control platform can obtain the log collector's minute-by-minute operating indicators for each task and / or process. The log collector can then plot the received operating indicators for each task and process over a continuous period of time into a table or dynamic graph, serving as corresponding visual indicator dynamic information. This visual indicator dynamic information can also be displayed for staff to review, allowing them to understand the operating status of each log collector.

[0105] Furthermore, the heartbeat in this embodiment includes the operating indicators of each task and / or the operating indicators of the process. In actual applications, these indicators can also be used to set alarm conditions, such as issuing an alarm when the number of bytes transmitted by a task reaches a preset value, or issuing an alarm when the CPU usage of the log collector's process reaches a preset ratio, etc. The log collector's management and control platform detects whether the alarm conditions are met based on the operating indicators of each task and / or process in the heartbeat. If so, an alarm is issued. When configuring the alarm conditions, an email address and phone number for receiving alarm information can also be entered. In this way, when an alarm is issued, an alarm information can be sent to the corresponding email address or phone number.

[0106] Further optionally, in the above embodiment, after sending the configuration file and configuration version number to the corresponding log collector, it may also include: if no heartbeat message sent by the log collector is received within a preset time length, sending a restart prompt message to prompt the user to restart the log collector.

[0107] Specifically, the preset time length can be configured based on actual needs. For example, the preset time length can be twice or three times the heartbeat message transmission period, or it can be set to another value greater than the heartbeat period. For example, if the heartbeat message is sent once every minute, the preset time length can be 5 minutes, 10 minutes, or another value. In this embodiment, if the log collector's control platform does not receive the heartbeat message sent by the log collector within the preset time length, it will issue a restart prompt message. After seeing the restart prompt message, the staff on the log collector side will restart the log collector. The restarted log collector will continue to execute the tasks corresponding to the previously received configuration file and send heartbeat messages to the log collector's control platform according to the preset period. After receiving the heartbeat message, the log collector's control platform will issue the updated configuration file to the log collector if there is an updated task. The log collector's control platform and each log collector operate according to this process, implementing control over each log collector and ensuring that each log collector executes the corresponding log collection task. This entire process does not require the user to manually deploy the configuration file on each log collector, effectively improving the configuration efficiency of log collection.

[0108] For example, in this embodiment, steps S102 and S103 can be used to initiate a task on the log collector side, and step (a1) can be used to configure a task pause. Upon receiving a heartbeat message for the corresponding log collection, the heartbeat message is sent to the log collector, allowing the log collector to pause the task. Therefore, in this embodiment, the log collector's management and control platform can flexibly control the collection tasks on the log collector, making it very convenient to implement.

[0109] Further optionally, the control platform of the log collector of this embodiment can also receive external query requests. For example, the query request can be sent by a user through a human-machine interface. The query request can carry the identification information of the host where the log collector is located. The control platform of the log collector can query the database relationship for the identification information of all tasks corresponding to the identification information of the host to obtain which tasks the log collection where the identification information of the host is located is performing. And display. Further query all task version numbers corresponding to the identification information of the host from the database relationship and display. Or the query request of this embodiment can carry a task identifier. In this case, the control platform of the log collector can query the identification information of the hosts of all log collectors that execute the task identifier from the database relationship to obtain which log collections execute the tasks corresponding to the task identifier. Or the query request of this embodiment can carry a task identifier and the corresponding task version number. In this case, the control platform of the log collector can query the identification information of the hosts of all log collectors that execute the task identifier with the task version number from the database relationship to obtain which log collections execute the tasks corresponding to the task identifier with the task version number. Alternatively, the query request of this embodiment can carry the group identification of the log collector. In this case, the management and control platform of the log collector can obtain the identification information of all log collection hosts corresponding to the group identification and display it to know which log collectors are under the group identification. Alternatively, the query request of this embodiment can carry other identification information, such as the host identification information, task identification, task version number and group identification, etc., to realize information query. The management and control platform of the log collector of this embodiment can provide rich query functions, provide queries on information related to any log collector and task, and is very convenient to use.

[0110] Further optionally, in another usage scenario of the present application, some task information such as task identification, task version information, etc. can also be pre-configured on the management and control platform of the log collector. When installing the log collector on multiple hosts maintained by the user, when the user configures the installation command of the log collector on each host, a task identification list parameter, such as the taskidlist parameter, can be added after the installation command to identify the identification information of the task to be performed by the log collector running on the host. In this embodiment, if the same task has only one version, the task identification information at this time can only include the task identification. If the same task has multiple versions, the task identification information here includes the task identification and the task version number. At this time, the scenario can include the following steps:

[0111] (a3) The management and control platform of the log collector receives a registration request from the log collector, which carries identification information of the task;

[0112] (b3) The management and control platform of the log collector generates a corresponding configuration file based on the identification information of each task;

[0113] (c3) The management and control platform of the log collector sends the corresponding configuration file to the log collector so that the log collector can load the configuration file and perform the corresponding task.

[0114] In this embodiment, when the log collector sends a registration request to the log collector's management and control platform, it also carries the task's identification information in the registration request. Similarly, in this embodiment, the task's identification information carried in the registration request can be one, two, or more.

[0115] Of course, the solution for this scenario can be the same as the above Figure 1 and Figure 2 The scheme is used in combination. At this time, when step (b3) generates the configuration file of the log collector for the first time, it is also necessary to configure its configuration version number accordingly, and send the configuration version number when sending the corresponding configuration file to the log collector for the first time. Subsequently, tasks can be configured for the log collector on the management and control platform side of the log collector, and this can be achieved according to the above embodiment. Please refer to the records of the above embodiment for details, which will not be repeated here. Of course, in actual applications, tasks may not be configured for the log collector later. The log collector only executes a few tasks set during installation, which is not limited here.

[0116] Furthermore, the log collector management and control method of the above embodiment can establish a correspondence between the host's identification information, task identification, and task version number; and store this information in a database relationship table, facilitating centralized management of the log collector and the tasks it executes, and facilitating subsequent query and use. Furthermore, in the above embodiment, the host's identification information and corresponding configuration file can also be stored in a cache, so that when the configuration file needs to be sent to the log collector later, it can be obtained in a timely manner, thereby improving the efficiency of log configuration file delivery.

[0117] Furthermore, the log collector management and control method of the above embodiment can also update the configuration file corresponding to the task identifier and the corresponding task version number according to the task update requirements; and based on the updated task identifier and the corresponding task version number, update the configuration file and configuration version number corresponding to the log collector that needs to execute the updated task, so that all relevant information can be updated in time for the newly updated task, which is convenient for subsequent accurate use.

[0118] Furthermore, the log collector management and control method of the above embodiment can also detect whether it is necessary to send an updated configuration file to the log collector based on the heartbeat message of the log collector, and send it when necessary, thereby ensuring that all updated configuration files can be sent to the log collector in a timely and accurate manner.

[0119] Furthermore, the log collector management and control method in the above embodiment can also provide dynamic visualization of the operating indicators of each task and / or process of the log collector, visually displaying all operating indicators, effectively enhancing the user experience. Furthermore, in the above embodiment, an alarm can be issued when certain operating indicators reach preset alarm conditions, effectively improving user safety.

[0120] Furthermore, in the log collector management and control method of the embodiment of the above embodiment, if no heartbeat message sent by the log collector is received within a preset time length, a prompt can be given to restart the log collector, so that the log collector can be restarted in time when a problem occurs in the log collector, which greatly improves the management efficiency of the log collector.

[0121] Figure 4 1 is a schematic diagram according to the third embodiment of the present application, which describes in detail the structure of the control platform 400 of the log collector of the present application. Figure 4 As shown, the management and control platform 400 of the log collector of this embodiment may specifically include:

[0122] The receiving module 401 is used to receive a registration request sent by a log collector; the registration request carries the identification information of the host where the log collector is located;

[0123] The configuration module 402 is used to configure a configuration file and a configuration version number for the log collector; the configuration file includes identification information of the tasks configured for the log collector; the configuration version number is used to identify the number of updates of the tasks configured for the log collector;

[0124] The sending module 403 is used to send the configuration file and the configuration version number to the corresponding log collector, so that the log collector can load the configuration file to perform the corresponding task.

[0125] Further optionally, in the management and control platform 400 of the log collector of this embodiment, the configuration module 402 is used to:

[0126] Configure the task ID and corresponding task version number for the log collector;

[0127] Generate the corresponding configuration file based on the task ID and corresponding task version number configured for the log collector;

[0128] Update the configuration version number of the log collector.

[0129] Further optionally, the management and control platform 400 of the log collector of this embodiment further includes:

[0130] The establishment module 404 is used to establish the corresponding relationship between the host identification information, the task identification, and the task version number; and store it in the database relationship table; and / or

[0131] The storage module 405 is used to store the host identification information and the corresponding configuration file in the cache.

[0132] Further optionally, the management and control platform 400 of the log collector of this embodiment further includes an update module 406 for:

[0133] Update the task identifier and the corresponding task version number according to the task update requirements;

[0134] Based on the updated task identifier and the corresponding task version number, update the configuration file and configuration version number corresponding to the log collector that needs to execute the updated task;

[0135] Update the corresponding relationship in the database relationship table corresponding to the log collector that needs to execute the updated task, and / or the corresponding configuration file in the cache.

[0136] Further optionally, the management and control platform 400 of the log collector of this embodiment further includes an acquisition module 407 and a detection module 408;

[0137] The receiving module 401 is used to receive the heartbeat message sent by the log collector according to a preset period. The heartbeat message carries the host identification information and the configuration version number;

[0138] The acquisition module 407 is used to obtain the configuration version number of the local record according to the identification information of the host;

[0139] The detection module 408 is used to detect whether the configuration version number recorded locally is consistent with the configuration version number carried in the heartbeat message;

[0140] The acquisition module 407 is further configured to acquire the corresponding updated configuration file from the cache according to the host identification information if there is any inconsistency; optionally, if the data in the cache is invalid, all task identifiers and task version numbers corresponding to the host identification information may be acquired according to the corresponding relationship to generate a configuration file;

[0141] The sending module 403 is used to send the updated configuration file and the locally recorded configuration version number to the corresponding log collector, so that the log collector can load the updated configuration file to perform the corresponding task.

[0142] Further optionally, in the control platform 400 of the log collector of this embodiment, the heartbeat message also carries the running indicators of each task and / or the running indicators of the log collector process; in this case, the control platform 400 of the log collector of this embodiment further includes:

[0143] The drawing module 409 is used to draw visual indicator dynamic information based on the running indicators of each task and / or process in the multiple consecutive heartbeat messages of the log collector;

[0144] The display module 410 is used to display dynamic information of visual indicators;

[0145] And / or the management and control platform 400 of the log collector of this embodiment also includes:

[0146] The alarm processing module 411 is used to determine whether an alarm needs to be triggered based on the operating indicators of each task and / or process in the log collector and the preset alarm conditions; if necessary, an alarm is issued according to the preset alarm method.

[0147] Further optionally, the management and control platform 400 of the log collector in this embodiment further includes:

[0148] The restart prompt module 412 is configured to send a restart prompt message to prompt the user to restart the log collector if no heartbeat message sent by the log collector is received within a preset time period.

[0149] It should be noted that Figure 4 In the embodiment, all the above optional solutions are taken as examples to describe the technical solution of the present invention. In practical applications, all the above optional solutions can be combined in any way to form the optional solution of the present application, and no further examples will be given here.

[0150] The management and control platform 400 of the log collector in this embodiment uses the above modules to implement the management and control of the log collector. The implementation principle and technical effects are the same as those of the above-mentioned related method embodiments. For details, please refer to the records of the above-mentioned related method embodiments, which will not be repeated here.

[0151] According to an embodiment of the present application, the present application also provides an electronic device and a readable storage medium.

[0152] like Figure 5 , is a block diagram of an electronic device according to the method for managing and controlling a log collector according to an embodiment of the present application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are provided as examples only and are not intended to limit the implementation of the present application described and / or claimed herein.

[0153] like Figure 5 As shown, the electronic device includes: one or more processors 501, a memory 502, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input / output device (such as a display device coupled to the interface). In other embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 5 A processor 501 is taken as an example.

[0154] Memory 502 is the non-transitory computer-readable storage medium provided in this application. The memory stores instructions executable by at least one processor, causing the at least one processor to execute the log collector management and control method provided in this application. The non-transitory computer-readable storage medium of this application stores computer instructions for causing a computer to execute the log collector management and control method provided in this application.

[0155] The memory 502 is a non-transient computer-readable storage medium that can be used to store non-transient software programs, non-transient computer executable programs and modules, such as the program instructions / modules corresponding to the management and control method of the log collector in the embodiment of the present application (for example, the attached Figure 4 The processor Y01 executes various functional applications and data processing of the server by running the non-transient software programs, instructions and modules stored in the memory 502, that is, implements the management and control method of the log collector in the above method embodiment.

[0156] The memory 502 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created based on the use of the electronic device under the control of the log collector, etc. In addition, the memory 502 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 502 may optionally include a memory remotely located relative to the processor 501, and these remote memories may be connected to the electronic device under the control of the log collector via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0157] The electronic device of the log collector management and control method may further include: an input device 503 and an output device 504. The processor 501, the memory 502, the input device 503 and the output device 504 may be connected via a bus or other means. Figure 5 The bus connection is taken as an example.

[0158] The input device 503 can receive input digital or character information and generate key signal input related to user settings and function control of the electronic device managed by the log collector, such as input devices such as a touch screen, a keypad, a mouse, a trackpad, a touch pad, an indicator stick, one or more mouse buttons, a trackball, a joystick, etc. The output device 504 may include a display device, an auxiliary lighting device (e.g., an LED), and a tactile feedback device (e.g., a vibration motor). The display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display, and a plasma display. In some embodiments, the display device may be a touch screen.

[0159] Various implementations of the systems and techniques described herein can be realized in digital electronic circuit systems, integrated circuit systems, dedicated ASICs (application specific integrated circuits), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0160] These computer programs (also referred to as programs, software, software applications, or code) include machine instructions for a programmable processor and can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and / or device (e.g., a magnetic disk, an optical disk, a memory, a programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.

[0161] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0162] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0163] Computer systems may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The client and server relationship arises through computer programs running on the respective computers and having a client-server relationship to each other.

[0164] According to the technical solution of the embodiment of the present application, through the management and control platform of the log collector, log collection tasks can be intelligently configured for each registered log collector, and the configuration file and configuration version number can be transmitted to the corresponding log collector so that the log collector can load the configuration file to perform the corresponding task. This overcomes the problem of low efficiency of manual configuration of log collection tasks in the prior art. In this application, by intelligently and automatically deploying and transmitting log collection tasks online, it can be applicable to large-scale log collection scenarios and effectively improve the configuration efficiency of log collection tasks.

[0165] Furthermore, the technical solution of the embodiments of the present application can establish a correspondence between the host's identification information, the task identifier, and the task version number; and store this correspondence in a database relational table, thereby facilitating centralized management of the log collector and the tasks it executes, and facilitating subsequent query and use. Furthermore, in the above embodiments, the host's identification information and the corresponding configuration file can also be stored in a cache, so that when the configuration file needs to be sent to the log collector later, it can be obtained in a timely manner, thereby improving the efficiency of log configuration file delivery.

[0166] Furthermore, the technical solution of the embodiment of the present application can also update the configuration file corresponding to the task identifier and the corresponding task version number according to the task update requirements; and based on the updated task identifier and the corresponding task version number, update the configuration file and configuration version number corresponding to the log collector that needs to execute the updated task, so that all relevant information can be updated in time for the newly updated task, facilitating subsequent accurate use.

[0167] Furthermore, the technical solution of the embodiment of the present application can also detect whether an updated configuration file needs to be sent to the log collector based on the heartbeat message of the log collector, and send it when necessary, thereby ensuring that all updated configuration files can be sent to the log collector in a timely and accurate manner.

[0168] Furthermore, the technical solutions of the embodiments of this application can also provide dynamic visualization of the operating indicators of each task and / or process of the log collector, visually displaying all operating indicators, effectively enhancing the user experience. Moreover, in the above embodiments, an alarm can be issued when certain operating indicators reach preset alarm conditions, effectively improving user safety.

[0169] Furthermore, the technical solution of the embodiment of the present application can also prompt to restart the log collector if the heartbeat message sent by the log collector is not received within a preset time length, so that the log collector can be restarted in time when a problem occurs in the log collector, which greatly improves the management efficiency of the log collector.

[0170] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this application can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this application can be achieved. This is not a limitation herein.

[0171] The above specific embodiments do not constitute a limitation on the scope of protection of this application. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application shall be included within the scope of protection of this application.

Claims

1. A log collector management and control method, characterized in that: The method is executed by the management and control platform of the log collector, and includes: Receive a registration request sent by a log collector; the registration request carries identification information of the host where the log collector is located; the registration request also carries a token field, which is configured when the log collector is installed; Verify and confirm that the token field configured by the user corresponding to the log collector is consistent with the token field in the registration request; A configuration file and a configuration version number are configured for the log collector; the configuration file includes identification information of the tasks configured for the log collector; the configuration version number is used to identify the number of updates to the tasks configured for the log collector; the identification information of the task includes a task identifier and a task version number; the initial value of the configuration version number is equal to the number of tasks configured when the configuration file is first configured for the corresponding log collector, and the configuration version number is incremented by 1 each time a task is updated in the configuration file; Sending the configuration file and the configuration version number to the corresponding log collector, so that the log collector can load the configuration file to perform the corresponding task; The method further includes: establishing a corresponding relationship between the identification information of the host, the task identifier, and the task version number; and storing the corresponding relationship in a database relationship table; The method further includes: updating the update task identifier and the corresponding update task version number according to the task update requirement; Based on the update task identifier and the update task version number, the configuration file and configuration version number corresponding to the log collector that executes the update task, and the corresponding relationship corresponding to the update task identifier in the database relationship table are updated.

2. The method according to claim 1, characterized in that Configure the corresponding configuration file and configuration version number for the log collector, including: Configure the task identifier and the corresponding task version number for the log collector; Generate the corresponding configuration file based on the task identifier and the corresponding task version number configured for the log collector; Configure the configuration version number of the log collector.

3. The method according to claim 2, characterized in that After configuring the corresponding configuration file and configuration version number for the log collector, the method further includes: The identification information of the host and the corresponding configuration file are stored in a cache.

4. The method according to claim 3, characterized in that After updating the configuration file and configuration version number corresponding to the log collector that executes the update task, and the corresponding relationship corresponding to the update task identifier in the database relationship table based on the update task identifier and the update task version number, the method further includes: The configuration file corresponding to the update task in the cache is updated.

5. The method according to claim 3, characterized in that After sending the configuration file and the configuration version number to the corresponding log collector, the method further includes: Receive a heartbeat message sent by the log collector according to a preset period, wherein the heartbeat message carries the identification information of the host and the configuration version number; Obtaining the locally recorded configuration version number according to the identification information of the host; Detect whether the configuration version number recorded locally is consistent with the configuration version number carried in the heartbeat message; If they are inconsistent, obtaining the corresponding updated configuration file from the cache according to the identification information of the host; The updated configuration file and the locally recorded configuration version number are sent to the corresponding log collector, so that the log collector can load the updated configuration file to execute the corresponding task.

6. The method according to claim 5, characterized in that The heartbeat message also carries the operating indicators of each task and / or the operating indicators of the log collector process; the method further includes: Drawing visual indicator dynamic information based on the running indicators of each task and / or the running indicators of the process in the heartbeat messages of the log collector for multiple times; displaying the visual indicator dynamic information; and / or According to the operation index of each task and / or the operation index of the process in the log collector and the preset alarm conditions, it is determined whether an alarm needs to be triggered; if necessary, an alarm is issued according to the preset alarm method.

7. The method according to any one of claims 1 to 6, characterized in that: After sending the configuration file and the configuration version number to the corresponding log collector, the method further includes: If the heartbeat message sent by the log collector is not received within a preset time length, a restart prompt message is sent to prompt the user to restart the log collector.

8. A log collector management and control platform, characterized in that: The platform includes: A receiving module, configured to receive a registration request sent by a log collector; the registration request carries identification information of the host where the log collector is located; the registration request also carries a token field, which is configured when the log collector is installed; A detection module, configured to verify and confirm that the token field configured by the user corresponding to the log collector is consistent with the token field in the registration request; A configuration module, configured to configure a configuration file and a configuration version number for the log collector; the configuration file includes identification information of tasks configured for the log collector; the configuration version number is used to identify the number of updates to the tasks configured for the log collector; the identification information of the task includes a task identifier and a task version number; the initial value of the configuration version number is equal to the number of tasks configured when the configuration file is first configured for the corresponding log collector, and the configuration version number is incremented by 1 each time a task is updated in the configuration file; A sending module, configured to send the configuration file and the configuration version number to the corresponding log collector, so that the log collector can load the configuration file to perform the corresponding task; The platform also includes: An establishment module is used to establish a correspondence between the host identification information, the task identification, and the task version number; and store the correspondence in a database relationship table; the platform also includes an acquisition module and a display module; Update modules for: According to the task update requirements, update the update task identifier and the corresponding update task version number; Based on the update task identifier and the update task version number, the configuration file and configuration version number corresponding to the log collector that executes the update task, and the corresponding relationship corresponding to the update task identifier in the database relationship table are updated.

9. The platform according to claim 8, characterized in that The configuration module is used to: Configure the task identifier and the corresponding task version number for the log collector; Generate the corresponding configuration file based on the task identifier and the corresponding task version number configured for the log collector; Configure the configuration version number of the log collector.

10. The platform according to claim 9, characterized in that The platform also includes: The storage module is used to store the identification information of the host and the corresponding configuration file in a cache.

11. The platform according to claim 10, characterized in that Update module, also used for: The configuration file corresponding to the update task in the cache is updated.

12. The platform according to claim 8, wherein: The receiving module is further configured to receive a heartbeat message sent by the log collector according to a preset period, wherein the heartbeat message carries the identification information of the host and the configuration version number; The acquisition module is configured to acquire the locally recorded configuration version number according to the identification information of the host; The detection module is used to detect whether the configuration version number recorded locally is consistent with the configuration version number carried in the heartbeat message; The acquisition module is further configured to acquire the corresponding updated configuration file from the cache according to the identification information of the host if there is inconsistency; The sending module is further configured to send the updated configuration file and the locally recorded configuration version number to the corresponding log collector, so that the log collector can load the updated configuration file to execute the corresponding task.

13. The platform according to claim 12, characterized in that The heartbeat message also carries the operating indicators of each task and / or the operating indicators of the log collector process; the platform also includes: A drawing module, configured to draw visual indicator dynamic information based on the running indicators of each task and / or the running indicators of the process in the heartbeat messages of the log collector for multiple times; The display module is used to display the dynamic information of the visualization indicator; And / or the platform further includes: The alarm processing module is used to determine whether an alarm needs to be triggered based on the operating indicators of each task and / or process in the log collector and the preset alarm conditions; if necessary, an alarm is issued according to the preset alarm method.

14. The platform according to any one of claims 8 to 13, characterized in that: The platform also includes: The restart prompt module is used to send a restart prompt message to prompt the user to restart the log collector if the heartbeat message sent by the log collector is not received within a preset time length.

15. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.

16. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 7.

17. A log collector management and control method, characterized in that: The method is executed by the management and control platform of the log collector, and includes: Receive a registration request sent by a log collector; the registration request carries identification information of the host where the log collector is located and identification information of the task; the registration request also carries a token field, which is configured when the log collector is installed; Verify and confirm that the token field configured by the user corresponding to the log collector is consistent with the token field in the registration request; Configuring a configuration file for the log collector according to the identification information of the task; the configuration file includes the identification information of the task configured for the log collector; the identification information of the task includes a task identifier and a task version number; Sending the configuration file to the corresponding log collector so that the log collector loads the configuration file to perform the corresponding task; The method further includes: establishing a corresponding relationship between the identification information of the host, the task identifier, and the task version number; and storing the corresponding relationship in a database relationship table; The method further includes: updating the update task identifier and the corresponding update task version number according to the task update requirement; Based on the update task identifier and the update task version number, the configuration file corresponding to the log collector that executes the update task and the corresponding relationship corresponding to the update task identifier in the database relationship table are updated.

Citation Information

Patent Citations

  • Method of pushing and receiving configuration information, server and client

    CN106487842A

  • Distributed event collection probe, distributed event high-speed collection system and method

    CN107864056A