Log retrieval method and device, medium and computer program product

By obtaining and decompressing the logs from the first server, and pushing the logs to the second server for display, the search difficulty caused by the short log storage time limit in the prior art is solved, and efficient search and display of logs exceeding the storage time limit is achieved.

CN120144542APending Publication Date: 2025-06-13北京理房通支付科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510151970.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-11
Publication Date
2025-06-13

AI Technical Summary

Technical Problem

In the prior art, the log storage time limit usually does not exceed two weeks, resulting in logs exceeding the storage time limit being unable to be retrieved on Kibana, affecting the efficiency of historical logs and problem detection.

Method used

By obtaining the log search request for the application name and date, the compressed file is obtained from the first server that stores the compressed file, and after decompression, the log is pushed to the second server, and the log is displayed through the visual component, which realizes the search of logs exceeding the storage time limit.

Benefits of technology

Even if the log exceeds the storage time limit, this embodiment can still realize the retrieval and display of logs, improving the efficiency of historical logs and the convenience of problem detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120144542A_ABST
    Figure CN120144542A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to a log retrieval method and device, a medium and a computer program product, a compressed file of a retrieved log can be obtained from a first server for storing the compressed file by obtaining an application name and a date for log retrieval, and then the compressed file is decompressed to obtain the retrieved log. According to the method, the retrieved log can be obtained, so that the log is pushed to the second server for collecting the log, and the log is displayed through the visual component. Even if the retrieved log exceeds the storage time limit, the log retrieval can be realized by the embodiment of the invention.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technologies, and in particular, to a log retrieval method, device, medium, and computer program product. Background Art

[0002] Currently, application logs are collected through a distributed messaging system (Kafka), processed by a data processing pipeline (Logstash), and then stored in a search and analysis engine (ElasticSearch, ES), and retrieved and displayed through a visualization component (Kibana).

[0003] However, due to capacity limitations, the retention period of online logs generally does not exceed two weeks. After the retention period, corresponding messages cannot be retrieved on Kibana. Summary of the Invention

[0004] To solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a log retrieval method, device, medium, and computer program product.

[0005] An embodiment of the present disclosure provides a log retrieval method, the method including:

[0006] Obtain a log retrieval request, where the log retrieval request includes: an application name and a date;

[0007] Based on the application name and the date, obtain a compressed file from a first server, where the compressed file is a compressed file of logs, and the first server is a server storing the compressed file;

[0008] Decompress the compressed file to obtain logs;

[0009] Push the logs to a second server and display the logs through a visualization component, where the second server is used to collect logs.

[0010] In some embodiments, obtaining a compressed file from a first server based on an application name and a date includes:

[0011] In the first server, find the location of the compressed file that matches the application name and the date;

[0012] Based on the location, obtain the compressed file from the first server.

[0013] In some embodiments, obtaining a compressed file from a first server based on an application name and a date includes:

[0014] Based on the application name and the date, store the compressed file in the first server in a preset folder;

[0015] Decompressing the compressed file to obtain logs includes:

[0016] Unzip the compressed file into a preset folder to obtain the log.

[0017] In some embodiments, before pushing the log to the second server, the method further includes:

[0018] Obtain the configuration file of the log push component based on the application name;

[0019] Update the configuration file, and the updated configuration file is used for the log push component to push the log to the second server.

[0020] In some embodiments, pushing the log to the second server includes:

[0021] Restart the push service so that the log push component pushes the log to the second server based on the updated configuration file.

[0022] In some embodiments, the method further includes:

[0023] Delete the logs in the preset folder that meet the preset conditions.

[0024] In some embodiments, the preset conditions include: the storage duration is greater than the preset duration.

[0025] An embodiment of the present disclosure also provides an electronic device, including: a processor; a memory for storing executable instructions of the processor; the processor is configured to read the executable instructions from the memory and execute the instructions to implement the log retrieval method provided by the embodiment of the present disclosure.

[0026] An embodiment of the present disclosure also provides a computer-readable storage medium, where the storage medium stores a computer program, and the computer program is used to execute the log retrieval method provided by the embodiment of the present disclosure.

[0027] An embodiment of the present disclosure also provides a computer program product, including a computer program, where the computer program, when executed by a processor, implements the log retrieval method provided by the embodiment of the present disclosure.

[0028] The above technical solution provided by the embodiment of the present disclosure can obtain the compressed file of the retrieved log from the first server storing the compressed file by obtaining the application name and date for log retrieval, and then by decompressing the compressed file, the retrieved log can be obtained, so as to push the log to the second server that collects the log and display the log through the visualization component. Even if the retrieved log exceeds the save time limit, this embodiment can still implement log retrieval.

[0029] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood from the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The accompanying drawings herein are incorporated into and constitute a part of this specification, showing embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure.

[0031] To more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following will briefly introduce the accompanying drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0032] Figure 1 It is a schematic flowchart of a log retrieval method provided for an embodiment of the present disclosure;

[0033] Figure 2 It is a schematic structural diagram of a log retrieval device provided for an embodiment of the present disclosure;

[0034] Figure 3 It is a schematic structural diagram of an electronic device provided for an embodiment of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0035] In order to be able to more clearly understand the above objects, features, and advantages of the present disclosure, the following will further describe the solutions of the present disclosure. It should be noted that, without conflict, the embodiments of the present disclosure and the features in the embodiments can be combined with each other.

[0036] Many specific details are set forth in the following description in order to fully understand the present disclosure, but the present disclosure can also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some embodiments of the present disclosure, rather than all embodiments.

[0037] For logs that exceed the retention period, although it is possible to apply for archived logs through a special process and download them one by one. However, there are the following problems: (1) The files may be large and distributed on multiple application servers, and it takes time for uploading and downloading; (2) It is not convenient to retrieve the files locally, which reduces the efficiency of R & D personnel in checking historical logs and troubleshooting online problems.

[0038] Figure 1 It is a schematic flowchart of a log retrieval method provided for an embodiment of the present disclosure, and this method can be executed by an electronic device. As Figure 1 shown, this method mainly includes but is not limited to steps 101 to 104:

[0039] In step 101, obtain a log retrieval request, which includes: an application name and a date.

[0040] For example, the user enters an application name and a date on the log retrieval page displayed by the visualization component (Kibana) and then submits the retrieval. The electronic device can obtain the log retrieval request of the visualization component (Kibana), and the application name and date entered by the user are included in the log retrieval request.

[0041] In step 102, based on the application name and the date, obtain a compressed file from the first server. The compressed file is a compressed file of the log, and the first server is the server storing the compressed file.

[0042] For example, based on the date in the log retrieval request and the current date, the electronic device can determine whether the log requested to be retrieved by the log retrieval request exceeds a preset retention period. If it exceeds, obtain the compressed file from the first server. The first server is the server storing the compressed file. For example, the first server is a log archiving server, and the compressed file of the log is stored in the log archiving server.

[0043] In step 103, decompress the compressed file to obtain the log.

[0044] For example, the electronic device decompresses the obtained compressed file, and the decompression method is determined based on the compression method of the compressed file. Since different compression methods can be used to compress the log, different decompression methods can be used to decompress the compressed file.

[0045] In step 104, push the log to the second server and display the log through the visualization component. The second server is used to collect the log.

[0046] For example, the electronic device pushes the decompressed log to the second server, which is used to collect the log. The second server can be a distributed message system (Kafka). Then, the electronic device uses the visualization component, such as the Kibana component, to display the decompressed log to the user, realizing log retrieval.

[0047] It can be seen that in this embodiment, by obtaining the application name and date for log retrieval, the compressed file of the retrieved log can be obtained from the first server storing the compressed file. Furthermore, by decompressing the compressed file, the retrieved log can be obtained, and then the log is pushed to the second server for collecting the log and displayed through the visualization component. Even if the retrieved log exceeds the retention period, log retrieval can still be achieved in this embodiment.

[0048] In some embodiments, in step 102, obtaining the compressed file from the first server based on the application name and the date includes the following (1) and (2):

[0049] (2) In the first server, find the location of the compressed file that matches the application name and date.

[0050] Among them, the compressed files stored in the first server (such as the log archiving server) have two attributes: application name and date. Therefore, the electronic device can find the location of the compressed file that matches the application name and log in the log archiving server in the log retrieval request.

[0051] (3) Based on the location, obtain the compressed file from the first server.

[0052] For example, the electronic device obtains the compressed file from the log archiving server based on the location of the compressed file in the log archiving server.

[0053] In some embodiments, in step 102, obtaining the compressed file from the first server based on the application name and date includes: storing the compressed files in the first server into a preset folder based on the application name and date.

[0054] For example, the electronic device can store the obtained compressed file into a preset folder, and the preset folder is, for example, a temporary folder or a folder with a predefined path.

[0055] Correspondingly, in step 103, decompressing the compressed file to obtain the log includes: decompressing the compressed file into a preset folder to obtain the log.

[0056] In some embodiments, in step 104, before pushing the log to the second server, the log retrieval method further includes the following (1) and (2):

[0057] (1) Based on the application name, obtain the configuration file of the log push component.

[0058] For example, the electronic device can pull the configuration file of the log push component based on the application name, where the log push component is, for example, the filebeat component.

[0059] (2) Update the configuration file of the log push component, and the updated configuration file is used for the log push component to push the log to the second server.

[0060] For example, the electronic device updates the configuration file of the log push component (such as the filebeat component) to the configuration file used for the log push component to push the log to the second server.

[0061] Correspondingly, in step 104, pushing the log to the second server includes: restarting the push service so that the log push component pushes the log to the second server based on the updated configuration file. The second server is, for example, a distributed message system (Kafka).

[0062] For example, after the electronic device updates the configuration file of the filebeat component, it restarts the push service to make the configuration file take effect. Based on the updated configuration file, the filebeat component pushes the logs to Kafka.

[0063] In some embodiments, the log retrieval method further includes:

[0064] Deleting the logs in the preset folder that meet the preset conditions.

[0065] Among them, the preset conditions include: the storage duration is greater than the preset duration. For example, the electronic device deletes the logs in the temporary folder whose storage duration is greater than 6 hours. The electronic device can perform the deletion operation periodically (for example, every 1 hour), and the period is set manually or is a preset period. This avoids the consumed logs from occupying disk space.

[0066] Embodiment 1

[0067] In this embodiment, the electronic device receives a log retrieval request, which includes: the application name and the date. If the date does not include the year, the log retrieval request also includes the year. The electronic device locates the archived logs according to the application name, date, and year, and extracts the found archived logs to the temporary folder. The key code is as follows:

[0068]

【#! / bin / bash

[0069] if [-z $3]

[0070] then

[0071] echo Useage: sh $0 2024 uacc 2024-03-12

[0072] exit 0

[0073] fi

[0074] year=$1

[0075] project=$2

[0076] day=$3

[0077] basedir= / mnt / cfs / logcenter / tomcatlogs / $year

[0078] cd $basedir

[0079] # Obtain the logs of the corresponding service on the corresponding date in the corresponding year, excluding the sql-related logs

[0080] for file in`ls

[0081] bj-*-p-app-${project}??_10.1* / ${project} / history / *${day}*gz

[0082] bj-*-p-app-${project}??_10.1* / ${project} / history / ${year}* / *${day}*gz|grep -v sql 2> / dev / null`

[0083] do

[0084] server_name=`echo $file|awk -F / '{print $1}'`

[0085] server_basedir=`echo $file|awk -F / '{print $2}'`

[0086] server_basename=`echo $file|awk -F / '{print $NF}'`

[0087] unzip_tmp_logdir= / data / tmp_log_archive / ${project} / $server_name; test -d $unzip_tmp_logdir || mkdir -p $unzip_tmp_logdir

[0088] #cp archive log to temporary directory

[0089] du -sh $file

[0090] cp $file $unzip_tmp_logdir

[0091] #enter the temporary directory to unzip

[0092] gzip -d $unzip_tmp_logdir / $server_basename

[0093] done

[0094] echo =========== du -sh

[0095] / data / tmp_log_archive / ${project} /

[0096] du-sh / data / tmp_log_archive / ${project} / *】。

[0097] Example 2

[0098] In this embodiment, the electronic device pulls the configuration file of filebeat using the application name, restarts the filebeat service after updating the configuration file, so that filebeat pushes the logs to Kafka. The key code is as follows:

[0099]

【basedir = / opt / log_archive

[0100] applist = `cat $basedir / config / applist|xargs`

[0101] filebeat_config = / home / worker / usr / local / filebeat-ke / filebeat.yml

[0102] tmpfilebeat_config = / tmp / .filebeat.yml

[0103] echo 'filebeat.prospectors:' >> $tmpfilebeat_config

[0104] for app in $applist

[0105] do

[0106] cat $basedir / template / filebeat_log_config|sed

[0107] "s / template_appname / ${app} / g" >> $tmpfilebeat_config

[0108] done

[0109] echo "output.kafka:

[0110] hosts: ['kafka109.mock.com:9092', 'kafka110.mock.com:9092', '

[0111] kafka111.mock.com:9092']

[0112] topic: '%{[fields][topic]}'">$tmpfilebeat_config

[0113] echo ================== cat $tmpfilebeat_config

[0114] cat $tmpfilebeat_config

[0115] cp $tmpfilebeat_config

[0116] / home / worker / usr / local / filebeat - ke / filebeat.yml

[0117] echo ================== systemctl restart filebeat - ke

[0118] / etc / init.d / filebeat - ke restart

[0119] echo ================== ps - ef | grep filebeat | grep -v grep

[0120] ps - ef | grep filebeat | grep -v grep】。

[0121] Example 3

[0122] In this embodiment, the electronic device deletes the logs stored in the temporary folder for more than 6 hours every 1 hour. The key code is as follows:

[0123] #! / bin / bash

[0124] # Find the directories in the temporary log directory that exceed 6 hours and clean them regularly

[0125] find / data / tmp_log_archive / -maxdepth 1 -cmin +360 | xargs rm –rf。

[0126] Corresponding to the foregoing log retrieval method, an embodiment of the present disclosure further provides a log retrieval device. Figure 2 As shown in the structure diagram of a log retrieval device provided by an embodiment of the present disclosure, the device can be implemented by software and / or hardware, and is generally integrated in an electronic device, such as Figure 2 shown, the log retrieval device includes:

[0127] The first acquisition unit 21 is configured to acquire a log retrieval request, where the log retrieval request includes: an application name and a date;

[0128] The second acquisition unit 22 is configured to acquire a compressed file from a first server based on the application name and the date, where the compressed file is a compressed file of logs, and the first server is a server storing the compressed file;

[0129] The decompression unit 23 is configured to decompress the compressed file to obtain logs;

[0130] The push unit 24 is configured to push the logs to a second server and display the logs through a visualization component, where the second server is used to collect the logs.

[0131] In some embodiments, the second acquisition unit 22 is configured to:

[0132] In the first server, find the location of the compressed file that matches the application name and the date;

[0133] Based on the location, acquire the compressed file from the first server.

[0134] In some embodiments, the second acquisition unit 22 is configured to:

[0135] Based on the application name and the date, store the compressed file in the first server into a preset folder;

[0136] The decompression unit 23 is configured to:

[0137] Decompress the compressed file into the preset folder to obtain logs.

[0138] In some embodiments, the log retrieval device further includes:

[0139] The pull unit is configured to acquire a configuration file of the log push component based on the application name;

[0140] The update unit is configured to update the configuration file of the log push component, and the updated configuration file is used for the log push component to push the logs to the second server.

[0141] The push unit 24 is configured to push the logs to the second server after the update unit completes the update.

[0142] In some embodiments, the push unit 24 is configured to:

[0143] Restart the push service so that the log push component pushes the logs to the second server based on the updated configuration file.

[0144] In some embodiments, the log retrieval device further includes:

[0145] A deletion unit for deleting logs in a preset folder that meet preset conditions, where the preset conditions include: the storage duration is greater than a preset duration.

[0146] The log retrieval device provided by the embodiments of the present disclosure can execute the log retrieval method provided by any embodiment of the present disclosure, and has corresponding functional modules and beneficial effects for executing the method.

[0147] Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the device embodiments described above can refer to the corresponding process in the method embodiments, and will not be elaborated here.

[0148] The embodiments of the present disclosure also provide an electronic device, which includes: a storage device on which a computer program is stored; a processing device for executing the computer program in the storage device to implement the steps of the log query method of the present disclosure. The processing device is used for:

[0149] Obtain a log retrieval request, where the log retrieval request includes: an application name and a date;

[0150] Based on the application name and the date, obtain a compressed file from a first server, where the compressed file is a compressed file of logs, and the first server is a server storing the compressed file;

[0151] Decompress the compressed file to obtain logs;

[0152] Push the logs to a second server and display the logs through a visualization component, where the second server is used to collect logs.

[0153] In some embodiments, obtaining a compressed file from a first server based on an application name and a date includes:

[0154] In the first server, find the location of the compressed file that matches the application name and the date;

[0155] Based on the location, obtain the compressed file from the first server.

[0156] In some embodiments, obtaining a compressed file from a first server based on an application name and a date includes:

[0157] Based on the application name and the date, store the compressed file in the first server in a preset folder;

[0158] Decompressing the compressed file to obtain logs includes:

[0159] Decompress the compressed file into a preset folder to obtain logs.

[0160] In some embodiments, before pushing the logs to the second server, the processing device is further used for:

[0161] Obtain the configuration file of the log push component based on the application name;

[0162] Update the configuration file, and the updated configuration file is used for the log push component to push logs to the second server.

[0163] In some embodiments, pushing the logs to the second server includes:

[0164] Restart the push service so that the log push component can push the logs to the second server based on the updated configuration file.

[0165] In some embodiments, the processing device is further configured to:

[0166] Delete the logs in the preset folder that meet the preset conditions.

[0167] In some embodiments, the preset conditions include: the storage duration is greater than the preset duration.

[0168] The following refers to Figure 3 , which shows a schematic structural diagram of an electronic device 300 suitable for implementing the embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet Computers), PMPs (Portable Multimedia Players), in-vehicle terminals (such as in-vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 3 The electronic device shown is only an example and should not impose any limitations on the functions and usage scope of the embodiments of the present disclosure.

[0169] As Figure 3 shown, the electronic device 300 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 301, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 302 or the program loaded from the storage device 308 into the random access memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the electronic device 300 are also stored. The processing device 301, the ROM 302, and the RAM 303 are connected to each other through a bus 304. The input / output (I / O) interface 305 is also connected to the bus 304.

[0170] Typically, the following devices can be connected to the I / O interface 305: input devices 306 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 308 including, for example, magnetic tapes, hard disks, etc.; and a communication device 309. The communication device 309 can allow the electronic device 300 to communicate with other devices wirelessly or wiredly to exchange data. Although Figure 3 the electronic device 300 with various devices is shown, it should be understood that it is not required to implement or have all the shown devices. Instead, more or fewer devices can be implemented or had.

[0171] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program carried on a non-transitory computer-readable medium, the computer program including program codes for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication device 309, or installed from the storage device 308, or installed from the ROM 302. When the computer program is executed by the processing device 301, the above functions defined in the method of the embodiment of the present disclosure are executed.

[0172] In addition to the above methods and devices, an embodiment of the present disclosure can also be a computer program product, which includes computer program instructions that cause the processor to execute the method provided by the embodiment of the present disclosure when the processor runs. The computer program product can be written in any combination of one or more programming languages for the program codes for performing the operations of the embodiment of the present disclosure. The programming languages include object-oriented programming languages such as Java, C++, etc., and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program codes can be executed entirely on the user computing device, partially on the user device, executed as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0173] Furthermore, an embodiment of the present disclosure can also be a computer-readable storage medium, on which computer program instructions are stored, and the computer program instructions cause the processor to execute the log retrieval method provided by the embodiment of the present disclosure when the processor runs.

[0174] The computer-readable storage medium may adopt any combination of one or more readable media. The readable media may be a readable signal medium or a readable storage medium. The readable storage medium may include, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the readable storage medium include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0175] Embodiments of the present disclosure further provide a computer program product, including a computer program / instructions, which implement the log retrieval method in the embodiments of the present disclosure when executed by a processor.

[0176] It can be understood that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, usage scopes, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0177] For example, when a user's active request is received, a prompt message is sent to the user to clearly prompt the user that the operation requested by the user will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, an application program, a server, or a storage medium that performs the operations of the technical solutions of the present disclosure according to the prompt message.

[0178] As an optional but non-limiting implementation manner, the manner of sending a prompt message to the user in response to receiving the user's active request may be, for example, a pop-up window manner, and the prompt message may be presented in text in the pop-up window. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0179] It can be understood that the above process of notifying and obtaining the user's authorization is only illustrative and does not limit the implementation manner of the present disclosure, and other manners that meet relevant laws and regulations can also be applied to the implementation manner of the present disclosure.

[0180] It should be noted that, in this document, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprising", "including" or any other variation thereof are intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the said element.

[0181] The above are only specific embodiments of the present disclosure, enabling those skilled in the art to understand or implement the present disclosure. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to these embodiments described herein, but rather to the broadest scope consistent with the principles and novel features disclosed herein.

Claims

1. A log retrieval method, characterized in that: include: Obtaining a log retrieval request, wherein the log retrieval request includes: an application name and a date; Based on the application name and the date, obtaining a compressed file from a first server, where the compressed file is a compressed file of a log, and the first server is a server storing the compressed file; Decompressing the compressed file to obtain a log; The log is pushed to a second server and displayed through a visualization component, where the second server is used to collect the log.

2. The method according to claim 1, characterized in that The obtaining the compressed file from the first server based on the application name and the date includes: In the first server, searching for a location of a compressed file matching the application name and the date; Based on the location, the compressed file is obtained from the first server.

3. The method according to claim 1, characterized in that: The obtaining the compressed file from the first server based on the application name and the date includes: Based on the application name and the date, storing the compressed file in the first server into a preset folder; Decompressing the compressed file to obtain a log includes: Decompress the compressed file into the preset folder to obtain the log.

4. The method according to claim 1, characterized in that Before pushing the log to the second server, the method further includes: Based on the application name, obtain a configuration file of the log push component; The configuration file is updated, and the updated configuration file is used by the log push component to push the log to the second server.

5. The method according to claim 4, characterized in that The step of pushing the log to the second server includes: Restart the push service so that the log push component pushes the log to the second server based on the updated configuration file.

6. The method according to claim 3, characterized in that The method further comprises: Delete the logs in the preset folder that meet the preset conditions.

7. The method according to claim 6, characterized in that The preset condition includes: the storage time is greater than the preset time.

8. An electronic device, characterized in that: The electronic device comprises: a storage device having a computer program stored thereon; A processing device, used to execute the computer program in the storage device to implement the steps of the log retrieval method according to any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and the computer program is used to execute the log retrieval method described in any one of claims 1 to 7.

10. A computer program product, characterized in that The method comprises a computer program, which implements the log retrieval method according to any one of claims 1 to 7 when executed by a processor.