WO2020253125A1 - 日志管理方法、装置、设备及存储介质 - Google Patents

日志管理方法、装置、设备及存储介质 Download PDF

Info

Publication number
WO2020253125A1
WO2020253125A1 PCT/CN2019/122073 CN2019122073W WO2020253125A1 WO 2020253125 A1 WO2020253125 A1 WO 2020253125A1 CN 2019122073 W CN2019122073 W CN 2019122073W WO 2020253125 A1 WO2020253125 A1 WO 2020253125A1
Authority
WO
WIPO (PCT)
Prior art keywords
log
archived
archiving
archive
abnormal state
Prior art date
Application number
PCT/CN2019/122073
Other languages
English (en)
French (fr)
Inventor
朱洲
Original Assignee
深圳壹账通智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳壹账通智能科技有限公司 filed Critical 深圳壹账通智能科技有限公司
Publication of WO2020253125A1 publication Critical patent/WO2020253125A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3065Monitoring arrangements determined by the means or processing involved in reporting the monitored data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/069Management of faults, events, alarms or notifications using logs of notifications; Post-processing of notifications

Definitions

  • This application relates to the technical field of log management, in particular to a log management method, device, equipment, and computer-readable storage medium.
  • Windows network operating devices are designed with various log files, such as application logs, security logs, device logs, Scheduler (scheduler) service logs, FTP (File Transfer Protocol, file transfer protocol) log, WWW (World Wide Web, World Wide Web) log, DNS (Domain Name System, Domain Name System) server logs, etc., which vary according to the different services that your device opens.
  • FTP File Transfer Protocol
  • WWW World Wide Web, World Wide Web
  • DNS Domain Name System
  • these log files usually record some related content of our operation, which is quite useful to equipment security staff. For example, someone has performed IPC (Inter-Process Communication, inter-process communication) detection, the device will quickly record in the security log the IP address (Internet Protocol Address, Internet Protocol address), time, user name, etc. After using FTP to detect, the IP, time, and user name used for detection will be recorded in the FTP log.
  • IPC Inter-Process Communication, inter-process communication
  • the log in the computer refers to log data, which can be a treasure trove of valuable information or a quagmire of worthless data.
  • log data from various operating devices, applications, devices, and security products can help detect and avoid disasters in advance, and find the root cause of security incidents.
  • log archiving is to upload the log files on the target server to an archive server for cache.
  • the log cache exceeds a limited time, the log is stored in the disk for archiving.
  • This process requires a customized script to achieve. Therefore, when the logs are archived, people who are familiar with the script need to manage it. For newcomers who do not understand the script, they don't know how to deal with it, and they dare not modify the script processing casually, which makes it inconvenient to archive the logs.
  • the main purpose of this application is to provide a log management method, device, equipment, and computer-readable storage medium, aiming to solve the technical problem that existing log archive management requires talents who understand scripts and is time-consuming and inconvenient.
  • this application provides a log management method, which includes the following steps:
  • the step of archiving the log to be archived according to the archiving rule includes:
  • the step of archiving the log to be archived according to the archiving rule includes:
  • Monitor whether the archiving task corresponding to the log to be archived has an abnormal state, and if the archiving task has an abnormal state, determine the remedial strategy corresponding to the abnormal state;
  • the log to be archived is archived.
  • the monitoring whether the archiving task corresponding to the log to be archived has an abnormal state, and if the archiving task has an abnormal state, the step of determining the remedial strategy corresponding to the abnormal state includes:
  • the step of obtaining the corresponding IP address and log path based on the instance name includes:
  • the method further includes:
  • the archive log corresponding to the positioning keyword is displayed in bright colors.
  • the archiving rule includes current limiting archiving, and the step of archiving the log to be archived according to the archiving rule includes:
  • archiving rule is current-limited archiving, sending the log to be archived to the cache queue corresponding to the log to be archived;
  • the split logs are sequentially archived.
  • the log management device includes:
  • the first obtaining module is configured to obtain the corresponding IP address and log path based on the instance name when the input instance name is received;
  • the second obtaining module is configured to obtain the corresponding log to be archived based on the IP address and the log path;
  • the selection module is used to determine the size of the log to be archived, and to determine the corresponding archiving rule based on the size of the log to be archived, the size of the log to be archived is the size of the memory occupied;
  • the archiving module is used to archive the logs to be archived according to the archiving rules.
  • the present application also provides a log management device, the log management device includes a processor, a memory, and computer-readable instructions stored on the memory and executable by the processor, wherein When the computer-readable instructions are executed by the processor, the steps of the log management method described above are implemented.
  • the present application also provides a computer-readable storage medium having computer-readable instructions stored on the computer-readable storage medium, and when the computer-readable instructions are executed by a processor, the implementation is as described above The steps of the log management method.
  • FIG. 1 is a schematic diagram of the hardware structure of a log management device involved in a solution of an embodiment of the application
  • Fig. 2 is a schematic flowchart of a first embodiment of a log management method for an application.
  • the log management method involved in the embodiments of the present application is mainly applied to log management equipment, and the log management equipment may be a device with display and processing functions such as a PC, a portable computer, and a mobile terminal.
  • FIG. 1 is a schematic diagram of the hardware structure of the log management device involved in the solution of the embodiment of the application.
  • the log management device may include a processor 1001 (for example, a CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005.
  • the communication bus 1002 is used to realize the connection and communication between these components;
  • the user interface 1003 may include a display (Display), an input unit such as a keyboard (Keyboard);
  • the network interface 1004 may optionally include a standard wired interface, a wireless interface (Such as WI-FI interface);
  • the memory 1005 can be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory.
  • the memory 1005 may optionally be a storage device independent of the aforementioned processor 1001.
  • FIG. 1 does not constitute a limitation on the log management device, and may include more or fewer components than shown in the figure, or a combination of certain components, or different component arrangements.
  • the memory 1005 as a computer-readable storage medium in FIG. 1 may include an operating system, a network communication module, and computer-readable instructions.
  • the network communication module is mainly used to connect to the server and perform data communication with the server; and the processor 1001 can call the computer-readable instructions stored in the memory 1005 and execute the log management method provided in the embodiment of the present application.
  • the embodiment of the present application provides a log management method, which can be used in a log management device, which is hereinafter referred to as a management device.
  • FIG. 2 is a schematic flowchart of a first embodiment of a log management method of this application.
  • the log management method includes the following steps:
  • Step S10 when the input instance name is received, obtain the corresponding IP address and log path based on the instance name;
  • Step S20 Obtain a corresponding log to be archived based on the IP address and the log path;
  • Step S30 Determine the size of the log to be archived, and determine a corresponding archiving rule based on the size of the log to be archived, and the size of the log to be archived is the size of the memory occupied;
  • Step S40 archive the log to be archived according to the archive rule.
  • the logs to be archived are obtained through the IP address and the log path, and the archiving rules are determined according to the size of the logs to be archived. Finally, the archived logs are archived according to the archiving rules. There is no need to customize scripts or specialized personnel who understand the scripts to process. , Realize the intelligent management of logs, improve the speed of log archiving and the ease of archiving.
  • Step S10 when the input instance name is received, the corresponding IP address and log path are obtained based on the instance name.
  • the management system when the user archives the log of a certain server, he only needs to enter the instance name on the corresponding display interface of the management system, and the management system can obtain the corresponding IP address and log path according to the received instance name.
  • the instance name refers to the name given by the user to the host of each server, that is, the management device is connected to multiple servers, and the host of each server has an instance name assigned by the user. For example, if the user wants to obtain the log information corresponding to the A server, he only needs to enter the instance name A of the A server in the management system, and the management system will then obtain the IP address and log path corresponding to the A server.
  • step S10 includes:
  • Step S11 when the input instance name is received, judge whether the instance name is valid
  • Step S12 if it is valid, obtain the archive link corresponding to the instance name
  • Step S13 Obtain the IP address corresponding to the archive link and the log path corresponding to the archive link.
  • the archive link corresponding to the instance name is obtained, and the corresponding IP address and log path are obtained based on the archive link.
  • the management device is connected to multiple servers, and each server can be managed.
  • each server When an event occurs on each server, it records the log information corresponding to the event.
  • the management device can create a database in advance to store the user's management
  • the instance name, IP address, and log path entered in the corresponding operation interface of the device are associated with the instance name, IP address, and log path based on SQL Voice (Structured Query Language) to generate an archive link.
  • SQL Voice Structured Query Language
  • the management system receives the input instance name, it can obtain the archive link corresponding to the instance name, and obtain the corresponding IP address and log path based on the archive link.
  • the input instance name when the input instance name is received, it also includes verification of the instance name to determine whether the instance name exists in the management system, that is, when the input instance name is received, it is determined whether the instance name is valid, such as The management device manages the A server and the B server. Then when the instance name is C, since C does not exist in the management device, the management device outputs an error prompt, prompting the user that the instance name does not exist.
  • Step S20 Obtain corresponding logs to be archived based on the IP address and the log path.
  • the management device determines which location in which server is the log to be archived according to the IP address and the log path. Specifically, the server corresponding to the IP address is determined by the IP address, and in the server, the log path is determined The log at the corresponding location is the log to be archived.
  • log information in the server there are many kinds of log information in the server, and these log information are cached in the corresponding location of the server. Some log information is needed by users, and some log information is not needed by users. Therefore, the management system needs to pass IP Address, determine the corresponding server, and then in the server, determine that the log information corresponding to the log path is the log to be archived that the user needs.
  • process of obtaining the logs to be archived also includes:
  • the target server Based on the IP address and the log path, it is determined whether the target server has a corresponding log to be archived, if it exists, Then obtain the log to be archived.
  • the management device needs to determine whether the target server has a corresponding log to be archived, specifically, determine whether the IP address corresponding to the instance name has a corresponding server, if not, determine that the instance name is invalid; if so , It is further judged whether the log path corresponding to the instance name exists in the server, if not, it is determined that the target server does not have the corresponding log to be archived, and if so, it executes to obtain the log to be archived.
  • the servers for management device management are limited. For servers that are not under the management of the management device, the management device has no right to obtain its log information, and for those servers that are under the jurisdiction of the management device but do not have the log path corresponding to the instance name The server and management system also cannot obtain the corresponding log to be archived. Only when a server under the management of the management system has a corresponding log path can the management system obtain the corresponding log to be archived.
  • Step S30 Determine the size of the log to be archived, and determine a corresponding archiving rule based on the size of the log to be archived.
  • the size of the log to be archived is the size of the memory occupied.
  • the size of the log to be archived is determined according to the acquired log to be archived, and the corresponding archiving rule is determined based on the size of the log to be archived, where the size of the log to be archived is the size of the memory occupied by the log to be archived .
  • the size of the log to be archived is determined, and the size of the log to be archived is compared with a preset threshold. If the size of the log to be archived is less than the preset threshold, the corresponding archiving rule is determined to be direct archiving; If the size is equal to or greater than the preset threshold, the corresponding archiving rule is determined to be current-limiting archiving, where current-limiting archiving specifically means adding the logs to be archived to the cache queue, and the logs to be archived will be archived in batches according to the cache queue, with a specific preset Batch size, according to the batch size, the logs to be archived are divided into several batches, and the logs to be archived into several batches are archived in turn. At this time, the management device will not crash due to too many data writes at one time.
  • Step S40 archive the log to be archived according to the archive rule.
  • the archived logs to be archived are archived according to the archive rules.
  • the logs to be archived can be obtained by copying or cutting, and the archived logs to be archived are archived according to the determined archiving rules.
  • step S40 includes:
  • archiving rule is current-limited archiving, sending the log to be archived to the cache queue corresponding to the log to be archived;
  • the log to be archived is first Send to the cache queue for segmentation processing instead of direct archiving. It is understandable that while the current log to be archived exists in the cache queue, there may also be other logs to be archived, that is, after the management device sends the log to be archived to the cache queue , Perform segmentation, and queue the segmented logs obtained from segmentation, so that the segmented logs can be archived in turn.
  • the management device divides the archived log according to the preset batch size to obtain at least two divided logs.
  • the size of the current log to be archived is 2G (Gigabyte, gigabyte or Jingbyte or ten Billion bytes or gurerds)
  • the preset batch size is 1G
  • the management device divides the current log to be archived into two 1G split logs.
  • the management device obtains the keywords contained in each split log, and prioritizes the split logs according to the keywords.
  • the keywords can refer to the attributes of the log to be archived. If the log to be archived is a security log, the corresponding The keyword of is security; when the log to be archived is a scheduling log, the corresponding keyword is scheduling, etc.
  • the priority of the security log is level 1
  • the scheduling day is level 3
  • the equipment log For level 2 the management device assigns priority to the split log after dividing the current log to be archived.
  • the split logs are sequentially archived.
  • the management device archives the split logs in order of priority according to the queuing status of the cache queue and the determined priority, until all split logs are archived successfully. Archive the archive log.
  • the priority of the split log is preferably for the same log to be archived corresponding to the split log, such as the current cache queue.
  • the log G to be archived is divided into split log f with priority 1 and split log g with priority 2, while log H to be archived is split into priority 5 Split log h and split log i with priority 2, but log H to be archived is ranked before log G to be archived in the cache queue.
  • the correct archive order is split log i, split log h, split log f and split Log g, that is, regardless of split log f How high is the priority of the file, it must wait for the archived log H that is ranked in front to be archived before it is archived.
  • step S40 includes:
  • Step S41 Determine the log type of the log to be archived, and determine the archive location corresponding to the log to be archived according to the log type.
  • the management device determines the archive location of the log to be archived according to the log type of the log to be archived.
  • Step S42 Archive the log to be archived to the archive location according to the archive rule.
  • the log to be archived is archived to the archive location according to the archiving rules. That is, each log to be archived has a corresponding archive location corresponding to it.
  • the archive location can also be determined by the log path in the archive link. According to the log path, a corresponding archive path can be created in the management device to archive the obtained logs to be archived to the archive location corresponding to the archive path. .
  • an archiving period can also be preset, and the management device regularly archives the archived logs according to the archiving period.
  • the corresponding IP address and log path are obtained based on the instance name; the corresponding log to be archived is obtained based on the IP address and the log path; the log to be archived is determined The size of the log is determined based on the size of the log to be archived, and the corresponding archiving rule is determined; and the log to be archived is archived according to the archiving rule.
  • This application obtains the target log to be archived through the IP address and log path, and determines the archiving rule according to the size of the log to be archived, and finally archives the archived log according to the archiving rule.
  • step S40 includes:
  • Step S43 monitoring whether the archiving task corresponding to the log to be archived has an abnormal state
  • Step S44 If an abnormal state occurs in the archiving task, determine the remedial strategy corresponding to the abnormal state;
  • Step S45 archiving the log to be archived according to the archiving rule and the remedial strategy.
  • the management device in the process of archiving logs to be archived, correspondingly creates an archive task, and when an abnormality in the archive task is detected, the corresponding remedial strategy is obtained, and the archived log to be archived is archived through the remedial strategy and archiving rules.
  • Step S43 Monitoring whether the archiving task corresponding to the log to be archived has an abnormal state.
  • the management device when the management device archives logs to be archived, it creates a corresponding archive task. Through the archive task, the archive status of the log to be archived can be obtained in time. The management device monitors the progress of the archive task in real time and judges whether it has an abnormal state. .
  • step S43 includes:
  • Step a Obtain the archive status code corresponding to the log to be archived
  • Step b according to the archive status code, monitor whether the archive task has an abnormal state.
  • the archive status of the archiving task is monitored in real time.
  • the specific monitoring method can be to compare the obtained logs to be archived with the archived logs corresponding to the logs to be archived in the management device.
  • the size of the archived log is compared with the size of the archived log.
  • the log to be archived is equal to the archived log, it is determined that the log to be archived is in a successful state; if the log to be archived is smaller than the archived log, it is determined that the log to be archived is in archive On this basis, if the archived log does not increase within the preset time, it is determined that the log to be archived is in the state of archive interruption; if the connection between the management device and the server corresponding to the log to be archived is interrupted, the log to be archived is determined In the state of archive failure, the way to determine whether the connection between the management device and the server corresponding to the log to be archived is interrupted can be: the management device periodically sends a network survival detection packet to the server corresponding to the log to be archived to detect the connection between the two Whether to interrupt.
  • the management device obtains the archive status code corresponding to the log to be archived, and determines whether the archive task is abnormal according to the archive status code.
  • the archive success and the archive indicate that the archive task is normal, and the archive interruption and failure indicate the archive task is abnormal.
  • Step S44 If an abnormal state occurs in the archiving task, a remedial strategy corresponding to the abnormal state is determined.
  • the management device determines that the archiving task is abnormal, the corresponding remediation strategy is determined according to the abnormal state. It is understandable that in the management device, a remediation strategy corresponding to each abnormal state is preset.
  • an exception occurs during the archiving process, such as server shutdown, breakpoints, etc.
  • remedial strategies will be adopted. For example, when the server is shut down during the archiving process, when the server is restored, the management device will continue to unarchive
  • the finished logs to be archived are archived. Specifically, when log data interruption is detected, the position mark of the current archived log is recorded, and when the server is restored, the position of the interruption of the log to be archived is located according to the position mark, and the unarchived log is continued to be obtained. Archived logs to be archived.
  • the remedial strategy also includes the reacquisition and re-archiving of archived logs, that is, if an archive fails during the archiving process, the archive will be abandoned, the archived logs will be deleted, and the logs to be archived will be retrieved according to the IP address and log path. Archive logs for re-archiving, etc.
  • step S44 includes:
  • Step c If an abnormal state occurs in the archiving task, determine the abnormal type corresponding to the abnormal state according to the archiving status code.
  • Step d Determine the remedial strategy corresponding to the abnormal type.
  • the management device adopts different remedial strategies. Specifically, when the abnormal type is archive interruption, mark and record the interruption location of the current archived log, and check whether the transmission path is unobstructed, which can be specified by the target server Send a detection packet to test whether the transmission path is unobstructed. When it is detected that the transmission path is unobstructed, locate the location where the archived logs are not archived according to the mark, and continue to obtain and archive unarchived logs that have not been archived; when the abnormal type is archive failure , Delete the archived part of the log to be archived, and re-obtain and archive the log to be archived according to the IP address and log path.
  • Step S45 archiving the log to be archived according to the archiving rule and the remedial strategy
  • the archived logs can be archived according to the archiving rules and remediation strategy.
  • the management device in the process of archiving the archived logs, creates an archive task correspondingly.
  • the corresponding remediation strategy is obtained, and the archived logs are archived through the remediation strategy and archiving rules to achieve log Intelligent management improves the success rate of log archiving.
  • a third embodiment of the log management method of this application is proposed based on the first embodiment and the second embodiment.
  • the difference between the third embodiment of the log management method and the first and second embodiments of the log management method is that the method further includes:
  • Step S50 when a query command of the historical log is received, obtain a query IP address corresponding to the query command;
  • Step S60 obtaining and displaying the archive log corresponding to the query IP address
  • step S70 when a positioning keyword based on the archive log is received, the archive log corresponding to the positioning keyword is displayed in bright colors.
  • the corresponding log can be directly displayed on the display interface, and the log that the user wants to find can be quickly located according to the keywords entered by the user.
  • Step S50 When a query command of the historical log is received, the query IP address corresponding to the query command is obtained.
  • Step S60 Obtain and display the archive log corresponding to the query IP address.
  • the management device after determining the query IP address, obtains and displays the corresponding archive log. It is understandable that the archive log displayed at this time is all log information of the server corresponding to the query IP address.
  • step S70 when a positioning keyword based on the archive log is received, the archive log corresponding to the positioning keyword is displayed in bright colors.
  • the management device also has a positioning function.
  • the user only needs to enter a positioning keyword on the relevant display interface. After receiving the positioning keyword, the management device can quickly locate the corresponding archive log, and, in order to facilitate the user to view , The located archive log is displayed in bright colors.
  • the corresponding log can be directly displayed on the display interface, and the log that the user wants to find can be quickly located according to the keywords entered by the user, so as to realize the fast log View.
  • the embodiment of the present application also provides a log management device.
  • the log management device includes:
  • the first obtaining module is configured to obtain the corresponding IP address and log path based on the instance name when the input instance name is received;
  • the second obtaining module is configured to obtain the corresponding log to be archived based on the IP address and the log path;
  • the selection module is used to determine the size of the log to be archived, and to determine the corresponding archiving rule based on the size of the log to be archived, the size of the log to be archived is the size of the memory occupied;
  • the archiving module is used to archive the logs to be archived according to the archiving rules.
  • archive module is also used for:
  • archive module is also used for:
  • Monitor whether the archiving task corresponding to the log to be archived has an abnormal state, and if the archiving task has an abnormal state, determine the remedial strategy corresponding to the abnormal state;
  • the log to be archived is archived.
  • archive module is also used for:
  • the first obtaining module is also used for:
  • log management device further includes:
  • the receiving module is used to obtain the query IP address corresponding to the query command when the query command of the historical log is received;
  • the third obtaining module is configured to obtain and display the archive log corresponding to the queried IP address
  • the positioning module is configured to display the archive log corresponding to the positioning keyword in bright colors when a positioning keyword based on the archive log is received.
  • the archiving rules include current limit archiving, and the archiving module is further used for:
  • archiving rule is current-limited archiving, sending the log to be archived to the cache queue corresponding to the log to be archived;
  • the split logs are sequentially archived.
  • each module and unit in the above-mentioned log management device corresponds to each step in the above-mentioned log management method embodiment, and their functions and implementation processes are not repeated here.
  • the embodiments of the present application also provide a computer-readable storage medium, and the computer-readable storage medium may be a non-volatile readable storage medium.
  • the computer-readable storage medium of the present application stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the log management method as described above are realized.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

一种日志管理方法、装置、设备及存储介质,涉及日志管理技术领域,所述方法包括以下步骤:当接收到输入的实例名时,基于所述实例名,获取对应的IP地址和日志路径(S10);基于所述IP地址和所述日志路径,获取对应的待归档日志(S20);确定所述待归档日志的大小,并基于所述待归档日志的大小,确定对应的归档规则,所述待归档日志的大小为所占内存的大小(S30);根据所述归档规则,对所述待归档日志进行归档(S40)。所述方法通过IP地址和日志路径,获取目标待归档日志,并根据待归档日志的大小确定归档规则,最后根据归档规则对待归档日志进行归档,无需专门定制脚本,也无需懂脚本的专门人员来处理,实现日志的智能管理,提高了日志的归档速度和归档的简易程度。

Description

日志管理方法、装置、设备及存储介质
本申请要求于2019年6月19日提交中国专利局、申请号为201910539988.1、发明名称为“日志管理方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在申请中。
技术领域
本申请涉及日志管理技术领域,尤其涉及一种日志管理方法、装置、设备及计算机可读存储介质。
背景技术
Windows网络操作设备都设计有各种各样的日志文件,如应用程序日志,安全日志、设备日志、Scheduler(调度程序)服务日志、FTP(File Transfer Protocol,文件传输协议)日志、WWW(World Wide Web,万维网)日志、DNS(Domain Name System,域名系统)服务器日志等等,这些根据你的设备开启的服务的不同而有所不同。我们在设备上进行一些操作时,这些日志文件通常会记录下我们操作的一些相关内容,这些内容对设备安全工作人员相当有用。比如说有人对设备进行了IPC(Inter-Process Communication,进程间通信)探测,设备就会在安全日志里迅速地记下探测者探测时所用的IP地址(Internet Protocol Address,网际协议地址)、时间、用户名等,用FTP探测后,就会在FTP日志中记下IP、时间、探测所用的用户名等。
  电脑里的日志是指日志数据,可以是有价值的信息宝库,也可以是毫无价值的数据泥潭。要保护和提高网络安全,由各种操作设备、应用程序、设备和安全产品的日志数据能够帮助提前发现和避开灾难,并且找到安全事件的根本原因。
目前日志的归档是将目标服务器上面的日志文档上传到一台归档服务器中缓存,当日志缓存超过限定时间时,将日志存入磁盘中进行归档,这过程中需要定制化的脚本才可以实现,因此在平时对日志进行归档时,需要熟悉脚本的人来管理,对于不懂脚本的新人来说,不知道该怎么处理,也不敢随便修改脚本处理,导致日志的归档很不方便。
发明内容
本申请的主要目的在于提供一种日志管理方法、装置、设备及计算机可读存储介质,旨在解决现有的日志归档管理需要懂脚本的人才行,且耗时不方便的技术问题。
为实现上述目的,本申请提供一种日志管理方法,所述日志管理方法包括以下步骤:
当接收到输入的实例名时,基于所述实例名,获取对应的IP地址和日志路径;
基于所述IP地址和所述日志路径,获取对应的待归档日志;
确定所述待归档日志的大小,并基于所述待归档日志的大小,确定对应的归档规则,所述待归档日志的大小为所占内存的大小;
根据所述归档规则,对所述待归档日志进行归档。
可选地,所述根据所述归档规则,对所述待归档日志进行归档的步骤包括:
确定所述待归档日志的日志类型,并根据所述日志类型确定所述待归档日志对应的归档位置;
根据所述归档规则,将所述待归档日志归档至所述归档位置。
可选地,所述根据所述归档规则,对所述待归档日志进行归档的步骤包括:
监测所述待归档日志对应的归档任务是否出现异常状态,若所述归档任务出现异常状态,则确定所述异常状态对应的补救策略;
根据所述归档规则和所述补救策略,对所述待归档日志进行归档。
可选地,所述监测所述待归档日志对应的归档任务是否出现异常状态,若所述归档任务出现异常状态,则确定所述异常状态对应的补救策略的步骤包括:
获取所述待归档日志对应的归档状态码,并根据所述归档状态码,监测所述归档任务是否出现异常状态。
若所述归档任务出现异常状态,则根据所述归档状态码,确定所述异常状态对应的异常类型;
确定所述异常类型对应的补救策略。
可选地,所述当接收到输入的实例名时,基于所述实例名,获取对应的IP地址和日志路径的步骤包括:
当接收到输入的实例名时,判断所述实例名是否有效;
若有效,则获取所述实例名对应的归档链接;
获取所述归档链接对应的IP地址和所述归档链接对应的日志路径。
可选地,所述根据所述归档规则,对所述待归档日志进行归档的步骤之后,所述方法还包括:
当接收到历史日志的查询指令时,获取所述查询指令对应的查询IP地址;
获取并显示所述查询IP地址对应的归档日志;
当接收到基于所述归档日志的定位关键字时,将所述定位关键字对应的归档日志以亮色显示。
所述归档规则包括限流归档,所述根据所述归档规则,对所述待归档日志进行归档的步骤包括:
若所述归档规则为限流归档,则将所述待归档日志发送至所述待归档日志对应的缓存队列;
按照预设批次大小,对所述待归档日志进行分割,以得到至少两个分割日志;
获取所述分割日志中包含的关键字,并基于所述关键字赋予所述分割日志不同的优先级;
基于所述缓存队列和所述优先级,依次对所述分割日志进行归档。
此外,为实现上述目的,本申请还提供一种日志管理装置,所述日志管理装置包括:
第一获取模块,用于当接收到输入的实例名时,基于所述实例名,获取对应的IP地址和日志路径;
第二获取模块,用于基于所述IP地址和所述日志路径,获取对应的待归档日志;
选取模块,用于确定所述待归档日志的大小,并基于所述待归档日志的大小,确定对应的归档规则,所述待归档日志的大小为所占内存的大小;
归档模块,用于根据所述归档规则,对所述待归档日志进行归档。
此外,为实现上述目的,本申请还提供一种日志管理设备,所述日志管理设备包括处理器、存储器、以及存储在所述存储器上并可被所述处理器执行的计算机可读指令,其中所述计算机可读指令被所述处理器执行时,实现如上述的日志管理方法的步骤。
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机可读指令,其中所述计算机可读指令被处理器执行时,实现如上述的日志管理方法的步骤。
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其他特征和优点将从说明书、附图以及权利要求书变得明显。
附图说明
图1为本申请实施例方案中涉及的日志管理设备的硬件结构示意图;
图2为本申请日志管理方法第一实施例的流程示意图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请实施例涉及的日志管理方法主要应用于日志管理设备,该日志管理设备可以是PC、便携计算机、移动终端等具有显示和处理功能的设备。
参照图1,图1为本申请实施例方案中涉及的日志管理设备的硬件结构示意图。本申请实施例中,日志管理设备可以包括处理器1001(例如CPU),通信总线1002,用户接口1003,网络接口1004,存储器1005。其中,通信总线1002用于实现这些组件之间的连接通信;用户接口1003可以包括显示屏(Display)、输入单元比如键盘(Keyboard);网络接口1004可选的可以包括标准的有线接口、无线接口(如WI-FI接口);存储器1005可以是高速RAM存储器,也可以是稳定的存储器(non-volatile memory),例如磁盘存储器,存储器1005可选的还可以是独立于前述处理器1001的存储装置。
本领域技术人员可以理解,图1中示出的硬件结构并不构成对日志管理设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
继续参照图1,图1中作为一种计算机可读存储介质的存储器1005可以包括操作系统、网络通信模块以及计算机可读指令。
在图1中,网络通信模块主要用于连接服务器,与服务器进行数据通信;而处理器1001可以调用存储器1005中存储的计算机可读指令,并执行本申请实施例提供的日志管理方法。
本申请实施例提供了一种日志管理方法,该方法可运用在日志管理设备中,日志管理设备以下简称管理设备。
参照图2,图2为本申请日志管理方法第一实施例的流程示意图。
本实施例中,所述日志管理方法包括以下步骤:
步骤S10,当接收到输入的实例名时,基于所述实例名,获取对应的IP地址和日志路径;
步骤S20,基于所述IP地址和所述日志路径,获取对应的待归档日志;
步骤S30,确定所述待归档日志的大小,并基于所述待归档日志的大小,确定对应的归档规则,所述待归档日志的大小为所占内存的大小;
步骤S40,根据所述归档规则,对所述待归档日志进行归档。
本实施例通过IP地址和日志路径,获取待归档日志,并根据待归档日志的大小确定归档规则,最后根据归档规则对待归档日志进行归档,无需专门定制脚本,也无需懂脚本的专门人员来处理,实现日志的智能管理,提高了日志的归档速度和归档的简易程度。
以下将对各个步骤进行详细的说明:
步骤S10,当接收到输入的实例名时,基于所述实例名,获取对应的IP地址和日志路径。
本实施例中,用户在对某个服务器的日志进行归档的时候,只需要在管理系统对应的显示界面输入实例名,管理系统即可根据接收到的实例名获取对应的IP地址和日志路径,其中,实例名指的是用户对每个服务器的主机所起的名字,即管理设备连接多台服务器,并且每一个服务器的主机都有用户赋予的实例名。如,用户想要获取A服务器对应的日志信息,只需在管理系统中输入A服务器的实例名A,管理系统即去获取A服务器对应的IP地址和日志路径。
进一步的,步骤S10包括:
步骤S11,当接收到输入的实例名时,判断所述实例名是否有效;
步骤S12,若有效,则获取所述实例名对应的归档链接;
步骤S13,获取所述归档链接对应的IP地址和所述归档链接对应的日志路径。
当接收到输入的实例名时,获取所述实例名对应的归档链接,并基于所述归档链接,获取对应的IP地址和日志路径。
可以理解的,管理设备连接有多台服务器,可对每台服务器进行管理,每台服务器发生事件时,都各自记录事件对应的日志信息,管理设备可事先创建一个数据库,用于储存用户在管理设备对应的操作界面输入的实例名、IP地址和日志路径,并基于SQL语音(Structured Query Language,结构化查询语言)将该实例名、IP地址和日志路径进行关联,生成归档链接。当管理系统接收到输入的实例名时,即可获取到该实例名对应的归档链接,并基于该归档链接获得对应的IP地址和日志路径。
可以理解的,在接收到输入的实例名时,还包括对该实例名进行验证,判断管理系统中是否存在该实例名,即在接收到输入的实例名时,判断该实例名是否有效,如管理设备管理有A服务器和B服务器,那么当实例名为C时,由于管理设备中不存在C,那么管理设备输出错误提示,提示用户不存在该实例名。
步骤S20,基于所述IP地址和所述日志路径,获取对应的待归档日志。
本实施例中,管理设备根据IP地址和日志路径,确定哪一服务器中的哪一位置是待归档日志,具体的,通过IP地址确定IP地址对应的服务器,在该服务器中,通过日志路径确定对应位置的日志为待归档日志。
可以理解的,在服务器中日志信息有多种多样,并且这些日志信息缓存在服务器对应的位置,有些日志信息是用户需要的,有些日志信息是用户不需要的,因此,管理系统需先通过IP地址,确定对应的服务器,再在该服务器中,确定日志路径对应的日志信息是用户需要的待归档日志。
若实例名对应的IP地址有一个,日志路径有多个,即归档链接中的IP地址对应的日志路径有多个,则在该IP地址对应的服务器中获取多个日志路径对应的待归档日志;若实例名对应的IP地址有多个,日志路径有一个,即归档链接中有多个IP地址对应同一日志路径,则在多个IP地址对应的服务器中获取该日志路径对应的待归档日志;若实例名对应的IP地址有多个,日志路径有多个,即归档链接中有多个IP地址对应多个日志路径,则在多个IP地址对应的服务器中获取多个日志路径对应的待归档日志。
进一步的,在获取待归档日志的过程中还包括:
基于所述IP地址和所述日志路径,确定是目标服务器否存在对应的待归档日志,若存在, 则获取所述待归档日志。
即在获取待归档日志之前,管理设备需判断目标服务器是否存在对应的待归档日志,具体的,判断实例名对应的IP地址是否有对应的服务器,若无,则确定该实例名无效;若有,则进一步判断实例名对应的日志路径在该服务器中是否存在,若无,则确定目标服务器不存在对应的待归档日志,若有,则执行获取待归档日志。
可以理解的,管理设备管理的服务器是有限的,对于不在管理设备管辖下的服务器,管理设备无权获取其日志信息,并且对于虽然在管理设备的管辖下,但是没有实例名对应的日志路径的服务器,管理系统也无法获取到对应的待归档日志。只有在管理系统管辖下的服务器,且存在对应的日志路径,管理系统才可获取到对应的待归档日志。
步骤S30,确定所述待归档日志的大小,并基于所述待归档日志的大小,确定对应的归档规则,所述待归档日志的大小为所占内存的大小。
本实施例中,根据获取到的待归档日志,确定待归档日志的大小,并基于待归档日志的大小,确定对应的归档规则,其中,待归档日志的大小为待归档日志所占内存的大小。
具体的,确定待归档日志的大小,并将待归档日志的大小与预设阈值进行比较,若待归档日志的大小小于预设阈值,则确定对应的归档规则为直接归档;若待归档日志的大小等于或者大于预设阈值,则确定对应的归档规则为限流归档,其中,限流归档具体表现为将待归档日志加入缓存队列,待归档日志将根据缓存队列分批归档,具体预设一个批次大小,根据批次大小,将待归档日志分割成若干批次,依次将分成若干批次的待归档日志进行归档,此时管理设备不会因为数据一次性写入过多而崩溃。
步骤S40,根据所述归档规则,对所述待归档日志进行归档。
本实施例中,在确定了归档规则后,根据归档规则对待归档日志进行归档,具体的,可通过复制或者剪切的方式,获取待归档日志,并依据确定归档规则对待归档日志进行归档。
进一步地,当归档规则为限流归档时,步骤S40包括:
若所述归档规则为限流归档,则将所述待归档日志发送至所述待归档日志对应的缓存队列;
在该步骤中,若归档规则为限流归档,即待归档日志的大小等于或者大于预设阈值,为避免管理一次性写入过多的数据而导致对应的系统崩溃,则将待归档日志先发送至缓存队列中进行分割处理,而不是直接归档,可以理解的,缓存队列中存在当前待归档日志的同时,也可能存在其他待归档日志,即管理设备在将待归档日志发送至缓存队列后,进行分割,并将分割所得的分割日志进行排队等候,以便后续能依次对分割日志进行归档。
按照预设批次大小,对所述待归档日志进行分割,以得到至少两个分割日志;
在该步骤中,管理设备根据预设批次大小,对待归档日志进行分割,以得到至少两个分割日志,如当前待归档日志的大小为2G(Gigabyte,吉咖字节或京字节或十亿字节或戟),预设批次大小为1G,则管理设备将当前待归档日志分割为两个1G大小的分割日志。
获取所述分割日志中包含的关键字,并基于所述关键字赋予所述分割日志不同的优先级;
在该步骤中,管理设备获取各个分割日志中包含的关键字,并根据关键字对分割日志进行优先级区分,关键字可指待归档日志的属性,如待归档日志为安全日志,则其对应的关键字为安全;待归档日志为调度日志时,其对应的关键字为调度等。
事先对各类日志的重要程度以阿拉伯数字1、2、3......进行分级,1级最高,依次降低,如安全日志的优先级为1级,调度日子为3级,设备日志为2级等,管理设备在将当前待归档日志进行分割后,对分割日志日志进行优先级赋予。
基于所述缓存队列和所述优先级,依次对所述分割日志进行归档。
在该步骤中,管理设备根据缓存队列的排队情况,以及确定的优先级,以优先级从高到低的顺序,依次对分割日志进行归档,直至所有的分割日志归档成功,此时,完成待归档日志的归档。
需要说明的是,在根据优先级进行依次归档的过程中,由于缓存队列可能存在其他的待归档日志,因此,分割日志的优先级优选针对分割日志所对应的同一待归档日志,如当前缓存队列中有待归档日志G和待归档日志H,其中待归档日志G被分割为优先级为1的分割日志f和优先级为2的分割日志g,而待归档日志H被分割为优先级为5的分割日志h和优先级为2的分割日志i,但待归档日志H在缓存队列中排在待归档日志G之前,因此,正确的归档顺序为分割日志i、分割日志h,分割日志f和分割日志g,即不管分割日志f 的优先级有多高,其也要等排在前面的待归档日志H归档完成才进行归档。
进一步的,步骤S40包括:
步骤S41,确定所述待归档日志的日志类型,并根据所述日志类型确定所述待归档日志对应的归档位置。
在获取到待归档日志后,通过判断待归档日志的日志类型,确定待归档日志的归档位置,其中,日志类型包括应用程序日志、安全日志、Scheduler服务日志、FTP日志、WWW日志、DNS服务器日志等,管理设备根据待归档日志的日志类型,确定待归档日志的归档位置。
步骤S42,根据所述归档规则,将所述待归档日志归档至所述归档位置。
在确定了待归档日志的归档位置后,根据归档规则,将待归档日志归档至该归档位置。即每一个待归档日志都有对应的归档位置与之对应。
需要说明的是,归档位置还可通过归档链接中的日志路径确定,具体可根据日志路径,在管理设备中新建一个对应的归档路径,将获取到的待归档日志归档至归档路径对应的归档位置。
进一步的,在将待归档日志进行归档的过程中,还可预设一个归档周期,管理设备根据归档周期定时对待归档日志进行归档。
本实施例当接收到输入的实例名时,基于所述实例名,获取对应的IP地址和日志路径;基于所述IP地址和所述日志路径,获取对应的待归档日志;确定所述待归档日志的大小,并基于所述待归档日志的大小,确定对应的归档规则;根据所述归档规则,对所述待归档日志进行归档。本申请通过IP地址和日志路径,获取目标待归档日志,并根据待归档日志的大小确定归档规则,最后根据归档规则对待归档日志进行归档,无需专门定制脚本,也无需懂脚本的专门人员来处理,并且不会因为一次性写入过多数据而导致系统崩溃,实现日志的智能管理,提高了日志的归档速度、归档的简易程度和管理设备的系统稳定性。
进一步地,基于第一实施例提出本申请日志管理方法的第二实施例。日志管理方法的第二实施例与日志管理方法的第一实施例的区别在于,步骤S40包括:
步骤S43,监测所述待归档日志对应的归档任务是否出现异常状态;
步骤S44,若所述归档任务出现异常状态,则确定所述异常状态对应的补救策略;
步骤S45,根据所述归档规则和所述补救策略,对所述待归档日志进行归档。
本实施例中,在对待归档日志进行归档的过程中,管理设备对应创建归档任务,当监测到归档任务出现异常时,获取对应的补救策略,通过补救策略和归档规则对待归档日志进行归档。
以下将对各个步骤进行详细说明:
步骤S43,监测所述待归档日志对应的归档任务是否出现异常状态。
本实施例中,管理设备在对待归档日志进行归档时,创建有对应的归档任务,通过归档任务可及时获取待归档日志的归档情况,管理设备实时监测归档任务的进程,判断其是否出现异常状态。
进一步的,步骤S43包括:
步骤a,获取所述待归档日志对应的归档状态码;
步骤b,根据所述归档状态码,监测所述归档任务是否出现异常状态。
在管理设备对待归档日志进行归档的过程中,实时监控归档任务的归档状态,具体监控方式可以是将获取到的待归档日志与管理设备中待归档日志对应的已归档日志进行比较,如将待归档日志的大小与已归档日志的大小进行比较,若待归档日志等于已归档日志,则判定待归档日志处于归档成功的状态;若待归档日志小于已归档日志,则判定待归档日志处于归档中的状态;在此基础上,若在预设时间内,已归档日志未增加,则判定待归档日志处于归档中断的状态;若管理设备与待归档日志对应的服务器连接中断,则判定待归档日志处于归档失败的状态,其中,确定管理设备与待归档日志对应的服务器之间连接是否中断的方式可以是:管理设备定时向待归档日志对应的服务器发送网络存活检测包,以检测两者的连接是否中断。将日志的归档状态(包括归档成功、归档中、归档中断和归档失败等)与归档状态码(如f_log_archive表)关联记录在数据库中,如archive_code=0,表示归档成功;archive_code=1,表示归档中;archive_code=-1,表示归档中断;archive_code=-2,表示归档失败。
管理设备通过获取待归档日志对应的归档状态码,并根据归档状态码确定归档任务是否出现异常,其中,归档成功和归档中表示归档任务正常,归档中断和归档失败表示归档任务异常。
步骤S44,若所述归档任务出现异常状态,则确定所述异常状态对应的补救策略。
若管理设备确定归档任务出现异常,则根据异常状态确定对应的补救策略,可以理解的,在管理设备中,预设有各个异常状态对应的补救策略。
具体的,若在归档过程中出现异常,如服务器关机,断点等,则采取对应的补救策略,如在归档过程中遇到服务器关机时,等服务器恢复时,管理设备会继续对之前未归档完的待归档日志进行归档,具体的,当检测到日志数据中断时,记录当前已归档日志的位置标记,并在服务器恢复时,根据该位置标记,定位待归档日志的中断位置,继续获取未归档完的待归档日志。
补救策略还包括对待归档日志的重新获取以及重新归档,即在归档过程中若出现归档失败,则放弃本次归档,删除已归档的日志,并重新根据IP地址和日志路径获取待归档日志,对待归档日志进行重新归档等。
进一步的,步骤S44包括:
步骤c,若所述归档任务出现异常状态,则根据所述归档状态码,确定所述异常状态对应的异常类型。
在本实施例中,将所有的归档过程中出现的所有异常状态分为若干异常类型,管理设备在确定归档任务出现异常状态后,根据归档状态码,确定对应的异常类型,如上所述,异常类型可包括archive_code=-1,归档中断;archive_code=-2,归档失败两种。
步骤d,确定所述异常类型对应的补救策略。
根据异常类型,管理设备采取不同的补救策略,具体的,当异常类型为归档中断时,对当前已归档日志的中断位置进行标记,并记录,并检测传输路径是否通畅,具体可通过想目标服务器发送检测包测试传输路径是否通畅,当检测到传输路径通畅时,根据标记,定位待归档日志未归档完成的位置,继续获取未归档完成的待归档日志并进行归档;当异常类型为归档失败时,删除待归档日志中已归档的部分,重新根据IP地址和日志路径获取待归档日志并进行归档。
步骤S45,根据所述归档规则和所述补救策略,对所述待归档日志进行归档;
在确定了补救策略后,即可根据归档规则和补救策略对待归档日志进行归档。
本实施例在对待归档日志进行归档的过程中,管理设备对应创建归档任务,当监测到归档任务出现异常时,获取对应的补救策略,通过补救策略和归档规则对待归档日志进行归档,实现日志的智能管理,提高日志的归档成功率。
进一步的,基于第一实施例和第二实施例提出本申请日志管理方法的第三实施例。日志管理方法的第三实施例与日志管理方法的第一实施例和第二实施例的区别在于,所述方法还包括:
步骤S50,当接收到历史日志的查询指令时,获取所述查询指令对应的查询IP地址;
步骤S60,获取并显示所述查询IP地址对应的归档日志;
步骤S70,当接收到基于所述归档日志的定位关键字时,将所述定位关键字对应的归档日志以亮色显示。
本实施例中,在将日志归档之后,若接收到历史日志的查询指令,则可直接在显示界面显示对应的日志,并且可根据用户输入的关键字迅速定位用户想要找的日志。
以下将对各个步骤进行详细说明:
步骤S50,当接收到历史日志的查询指令时,获取所述查询指令对应的查询IP地址。
在本实施例中,在对待归档日志进行归档之后,若用户想要查看相关的日志信息,只需在对应的查询界面输入对应的IP地址,管理设备在接收到查询指令时,即可获取到对应的IP地址。可以理解的,由于本方案引入实例名的概念,因此,用户在实际操作中即使不知道想要查看的服务器的IP地址,也可以通过输入实例名进行查看。
步骤S60,获取并显示所述查询IP地址对应的归档日志。
在本实施例中,管理设备在确定查询IP地址后,获取并显示对应的归档日志,可以理解的,此时显示的归档日志是该查询IP地址对应的服务器的全部日志信息。
步骤S70,当接收到基于所述归档日志的定位关键字时,将所述定位关键字对应的归档日志以亮色显示。
在本实施例中,管理设备还具备定位功能,用户只需在相关显示界面输入定位关键字,管理设备在接收到定位关键字后,即可快速定位对应的归档日志,并且,为了方便用户查看,将定位的归档日志以亮色显示。
本实施例在将日志归档之后,若接收到历史日志的查询指令,则可直接在显示界面显示对应的日志,并且可根据用户输入的关键字迅速定位用户想要找的日志,实现日志的快速查看。
此外,本申请实施例还提供一种日志管理装置。
本实施例中,所述日志管理装置包括:
第一获取模块,用于当接收到输入的实例名时,基于所述实例名,获取对应的IP地址和日志路径;
第二获取模块,用于基于所述IP地址和所述日志路径,获取对应的待归档日志;
选取模块,用于确定所述待归档日志的大小,并基于所述待归档日志的大小,确定对应的归档规则,所述待归档日志的大小为所占内存的大小;
归档模块,用于根据所述归档规则,对所述待归档日志进行归档。
进一步地,所述归档模块还用于:
确定所述待归档日志的日志类型,并根据所述日志类型确定所述待归档日志对应的归档位置;
根据所述归档规则,将所述待归档日志归档至所述归档位置。
进一步地,所述归档模块还用于:
监测所述待归档日志对应的归档任务是否出现异常状态,若所述归档任务出现异常状态,则确定所述异常状态对应的补救策略;
根据所述归档规则和所述补救策略,对所述待归档日志进行归档。
进一步地,所述归档模块还用于:
获取所述待归档日志对应的归档状态码,并根据所述归档状态码,监测所述归档任务是否出现异常状态;
若所述归档任务出现异常状态,则根据所述归档状态码,确定所述异常状态对应的异常类型;
确定所述异常类型对应的补救策略。
进一步地,所述第一获取模块还用于:
当接收到输入的实例名时,判断所述实例名是否有效;
若有效,则获取所述实例名对应的归档链接;
获取所述归档链接对应的IP地址和所述归档链接对应的日志路径。
进一步地,所述日志管理装置还包括:
接收模块,用于当接收到历史日志的查询指令时,获取所述查询指令对应的查询IP地址;
第三获取模块,用于获取并显示所述查询IP地址对应的归档日志;
定位模块,用于当接收到基于所述归档日志的定位关键字时,将所述定位关键字对应的归档日志以亮色显示。
进一步地,所述归档规则包括限流归档,所述归档模块还用于:
若所述归档规则为限流归档,则将所述待归档日志发送至所述待归档日志对应的缓存队列;
按照预设批次大小,对所述待归档日志进行分割,以得到至少两个分割日志;
获取所述分割日志中包含的关键字,并基于所述关键字赋予所述分割日志不同的优先级;
基于所述缓存队列和所述优先级,依次对所述分割日志进行归档。
其中,上述日志管理装置中各个模块和单元与上述日志管理方法实施例中各步骤相对应,其功能和实现过程在此处不再一一赘述。
此外,本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质可以为非易失性可读存储介质。
本申请计算机可读存储介质上存储有计算机可读指令,其中所述计算机可读指令被处理器执行时,实现如上述的日志管理方法的步骤。
其中,计算机可读指令被执行时所实现的方法可参照本申请日志管理方法的各个实施例,此处不再赘述。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者系统中还存在另外的相同要素。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (20)

  1. 一种日志管理方法,其中,所述日志管理方法包括以下步骤:
    当接收到输入的实例名时,基于所述实例名,获取对应的网际协议地址IP地址和日志路径;
    基于所述IP地址和所述日志路径,获取对应的待归档日志;
    确定所述待归档日志的大小,并基于所述待归档日志的大小,确定对应的归档规则,所述待归档日志的大小为所占内存的大小;
    根据所述归档规则,对所述待归档日志进行归档;
    其中,所述实例名用于表征服务器的名称,所述当接收到输入的实例名时,基于所述实例名,获取对应的IP地址和日志路径的步骤包括:
    当接收到输入的实例名时,判断所述实例名是否有效;
    若有效,则获取所述实例名对应的归档链接;
    获取所述归档链接对应的IP地址和所述归档链接对应的日志路径。
  2. 如权利要求1所述的日志管理方法,其中,所述根据所述归档规则,对所述待归档日志进行归档的步骤包括:
    确定所述待归档日志的日志类型,并根据所述日志类型确定所述待归档日志对应的归档位置;
    根据所述归档规则,将所述待归档日志归档至所述归档位置。
  3. 如权利要求1所述的日志管理方法,其中,所述根据所述归档规则,对所述待归档日志进行归档的步骤包括:
    监测所述待归档日志对应的归档任务是否出现异常状态,若所述归档任务出现异常状态,则确定所述异常状态对应的补救策略;
    根据所述归档规则和所述补救策略,对所述待归档日志进行归档。
  4. 如权利要求3所述的日志管理方法,其中,所述监测所述待归档日志对应的归档任务是否出现异常状态,若所述归档任务出现异常状态,则确定所述异常状态对应的补救策略的步骤包括:
    获取所述待归档日志对应的归档状态码,并根据所述归档状态码,监测所述归档任务是否出现异常状态;
    若所述归档任务出现异常状态,则根据所述归档状态码,确定所述异常状态对应的异常类型;
    确定所述异常类型对应的补救策略。
  5. 如权利要求1所述的日志管理方法,其中,所述根据所述归档规则,对所述待归档日志进行归档的步骤之后,所述方法还包括:
    当接收到历史日志的查询指令时,获取所述查询指令对应的查询IP地址;
    获取并显示所述查询IP地址对应的归档日志;
    当接收到基于所述归档日志的定位关键字时,将所述定位关键字对应的归档日志以亮色显示。
  6. 如权利要求1所述的日志管理方法,其中,所述归档规则包括限流归档,所述根据所述归档规则,对所述待归档日志进行归档的步骤包括:
    若所述归档规则为限流归档,则将所述待归档日志发送至所述待归档日志对应的缓存队列;
    按照预设批次大小,对所述待归档日志进行分割,以得到至少两个分割日志;
    获取所述分割日志中包含的关键字,并基于所述关键字赋予所述分割日志不同的优先级;
    基于所述缓存队列和所述优先级,依次对所述分割日志进行归档。
  7. 一种日志管理装置,其中,所述日志管理装置包括:
    第一获取模块,用于当接收到输入的实例名时,基于所述实例名,获取对应的IP地址和日志路径;
    第二获取模块,用于基于所述IP地址和所述日志路径,获取对应的待归档日志;
    选取模块,用于确定所述待归档日志的大小,并基于所述待归档日志的大小,确定对应的归档规则,所述待归档日志的大小为所占内存的大小;
    归档模块,用于根据所述归档规则,对所述待归档日志进行归档;
    其中,所述实例名用于表征服务器的名称,所述当接收到输入的实例名时,基于所述实例名,获取对应的IP地址和日志路径的步骤包括:
    当接收到输入的实例名时,判断所述实例名是否有效;
    若有效,则获取所述实例名对应的归档链接;
    获取所述归档链接对应的IP地址和所述归档链接对应的日志路径。
  8. 如权利要求7所述的日志管理装置,其中,所述归档模块40还用于:
    确定所述待归档日志的日志类型,并根据所述日志类型确定所述待归档日志对应的归档位置;
    根据所述归档规则,将所述待归档日志归档至所述归档位置。
  9. 如权利要求7所述的日志管理装置,其中,所述归档模块40还用于:
    监测所述待归档日志对应的归档任务是否出现异常状态,若所述归档任务出现异常状态,则确定所述异常状态对应的补救策略;
    根据所述归档规则和所述补救策略,对所述待归档日志进行归档。
  10. 如权利要求8所述的日志管理装置,其中,所述归档模块40还用于:
    获取所述待归档日志对应的归档状态码,并根据所述归档状态码,监测所述归档任务是否出现异常状态;
    若所述归档任务出现异常状态,则根据所述归档状态码,确定所述异常状态对应的异常类型;
    确定所述异常类型对应的补救策略。
  11. 如权利要求7所述的日志管理装置,其中,所述日志管理装置还包括:
    接收模块,用于当接收到历史日志的查询指令时,获取所述查询指令对应的查询IP地址;
    第三获取模块,用于获取并显示所述查询IP地址对应的归档日志;
    定位模块,用于当接收到基于所述归档日志的定位关键字时,将所述定位关键字对应的归档日志以亮色显示。
  12. 如权利要求7所述的日志管理装置,其中,所述归档规则包括限流归档,所述归档模块40还用于:
    若所述归档规则为限流归档,则将所述待归档日志发送至所述待归档日志对应的缓存队列;
    按照预设批次大小,对所述待归档日志进行分割,以得到至少两个分割日志;
    获取所述分割日志中包含的关键字,并基于所述关键字赋予所述分割日志不同的优先级;
    基于所述缓存队列和所述优先级,依次对所述分割日志进行归档。
  13. 一种日志管理设备,其中,所述日志管理设备包括处理器、存储器、以及存储在所述存储器上并可被所述处理器执行的计算机可读指令,其中所述计算机可读指令被所述处理器执行时,实现如下步骤:
    当接收到输入的实例名时,基于所述实例名,获取对应的网际协议地址IP地址和日志路径;
    基于所述IP地址和所述日志路径,获取对应的待归档日志;
    确定所述待归档日志的大小,并基于所述待归档日志的大小,确定对应的归档规则,所述待归档日志的大小为所占内存的大小;
    根据所述归档规则,对所述待归档日志进行归档;
    其中,所述实例名用于表征服务器的名称,所述当接收到输入的实例名时,基于所述实例名,获取对应的IP地址和日志路径的步骤包括:
    当接收到输入的实例名时,判断所述实例名是否有效;
    若有效,则获取所述实例名对应的归档链接;
    获取所述归档链接对应的IP地址和所述归档链接对应的日志路径。
  14. 如权利要求13所述的日志管理设备,其中,所述根据所述归档规则,对所述待归档日志进行归档的步骤包括:
    确定所述待归档日志的日志类型,并根据所述日志类型确定所述待归档日志对应的归档位置;
    根据所述归档规则,将所述待归档日志归档至所述归档位置。
  15. 如权利要求13所述的日志管理设备,其中,所述根据所述归档规则,对所述待归档日志进行归档的步骤包括:
    监测所述待归档日志对应的归档任务是否出现异常状态,若所述归档任务出现异常状态,则确定所述异常状态对应的补救策略;
    根据所述归档规则和所述补救策略,对所述待归档日志进行归档。
  16. 如权利要求15所述的日志管理设备,其中,所述监测所述待归档日志对应的归档任务是否出现异常状态,若所述归档任务出现异常状态,则确定所述异常状态对应的补救策略的步骤包括:
    获取所述待归档日志对应的归档状态码,并根据所述归档状态码,监测所述归档任务是否出现异常状态;
    若所述归档任务出现异常状态,则根据所述归档状态码,确定所述异常状态对应的异常类型;
    确定所述异常类型对应的补救策略。
  17. 一种计算机可读存储介质,其中,所述计算机可读存储介质上存储有计算机可读指令,其中所述计算机可读指令被处理器执行时,实现如下步骤:
    当接收到输入的实例名时,基于所述实例名,获取对应的网际协议地址IP地址和日志路径;
    基于所述IP地址和所述日志路径,获取对应的待归档日志;
    确定所述待归档日志的大小,并基于所述待归档日志的大小,确定对应的归档规则,所述待归档日志的大小为所占内存的大小;
    根据所述归档规则,对所述待归档日志进行归档;
    其中,所述实例名用于表征服务器的名称,所述当接收到输入的实例名时,基于所述实例名,获取对应的IP地址和日志路径的步骤包括:
    当接收到输入的实例名时,判断所述实例名是否有效;
    若有效,则获取所述实例名对应的归档链接;
    获取所述归档链接对应的IP地址和所述归档链接对应的日志路径。
  18. 如权利要求17所述的计算机可读存储介质,其中,所述根据所述归档规则,对所述待归档日志进行归档的步骤包括:
    确定所述待归档日志的日志类型,并根据所述日志类型确定所述待归档日志对应的归档位置;
    根据所述归档规则,将所述待归档日志归档至所述归档位置。
  19. 如权利要求17所述的计算机可读存储介质,其中,所述根据所述归档规则,对所述待归档日志进行归档的步骤包括:
    监测所述待归档日志对应的归档任务是否出现异常状态,若所述归档任务出现异常状态,则确定所述异常状态对应的补救策略;
    根据所述归档规则和所述补救策略,对所述待归档日志进行归档。
  20. 如权利要求19所述的计算机可读存储介质,其中,所述监测所述待归档日志对应的归档任务是否出现异常状态,若所述归档任务出现异常状态,则确定所述异常状态对应的补救策略的步骤包括:
    获取所述待归档日志对应的归档状态码,并根据所述归档状态码,监测所述归档任务是否出现异常状态;
    若所述归档任务出现异常状态,则根据所述归档状态码,确定所述异常状态对应的异常类型;
    确定所述异常类型对应的补救策略。
PCT/CN2019/122073 2019-06-19 2019-11-29 日志管理方法、装置、设备及存储介质 WO2020253125A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910539988.1 2019-06-19
CN201910539988.1A CN110377481B (zh) 2019-06-19 2019-06-19 日志管理方法、装置、设备及存储介质

Publications (1)

Publication Number Publication Date
WO2020253125A1 true WO2020253125A1 (zh) 2020-12-24

Family

ID=68250489

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/122073 WO2020253125A1 (zh) 2019-06-19 2019-11-29 日志管理方法、装置、设备及存储介质

Country Status (2)

Country Link
CN (1) CN110377481B (zh)
WO (1) WO2020253125A1 (zh)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110377481B (zh) * 2019-06-19 2022-06-28 深圳壹账通智能科技有限公司 日志管理方法、装置、设备及存储介质
CN110990335B (zh) * 2019-12-06 2023-07-18 深圳前海微众银行股份有限公司 日志归档方法、装置、设备及计算机可读存储介质
CN113656358A (zh) * 2020-05-12 2021-11-16 网联清算有限公司 一种数据库日志文件处理方法及系统
CN112463571A (zh) * 2020-12-17 2021-03-09 未来电视有限公司 一种日志处理方法、装置及设备
CN113238913B (zh) * 2021-05-12 2023-10-24 康键信息技术(深圳)有限公司 服务器故障智能推送方法、装置、设备及存储介质
CN115827678B (zh) * 2023-02-15 2023-05-23 零犀(北京)科技有限公司 一种获取业务数据的方法、装置、介质及电子设备

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080162601A1 (en) * 2006-12-28 2008-07-03 International Business Machines Corporation Scan-free archiving
CN105005528A (zh) * 2015-06-26 2015-10-28 浪潮(北京)电子信息产业有限公司 一种日志信息提取方法及装置
CN107451034A (zh) * 2017-08-17 2017-12-08 浪潮软件股份有限公司 一种大数据集群日志管理装置、方法及系统
CN107819616A (zh) * 2017-10-30 2018-03-20 杭州安恒信息技术有限公司 自动提取日志的方法、装置及系统
CN107870842A (zh) * 2016-09-28 2018-04-03 平安科技(深圳)有限公司 一种日志管理方法及系统
CN110377481A (zh) * 2019-06-19 2019-10-25 深圳壹账通智能科技有限公司 日志管理方法、装置、设备及存储介质

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8549239B2 (en) * 2007-06-20 2013-10-01 Hewlett-Packard Development Company, L.P. Network message logging and archival
CN105577445A (zh) * 2015-12-30 2016-05-11 北京京东尚科信息技术有限公司 一种日志收集和上报的方法和装置
CN107342888A (zh) * 2016-12-02 2017-11-10 杭州迪普科技股份有限公司 日志报文的存储方法及装置
CN107092552B (zh) * 2017-03-10 2020-09-04 武汉斗鱼网络科技有限公司 一种日志管理方法及装置
CN107426023B (zh) * 2017-07-21 2020-05-29 携程旅游信息技术(上海)有限公司 云平台日志收集和转发方法、系统、设备及存储介质
CN108989471A (zh) * 2018-09-05 2018-12-11 郑州云海信息技术有限公司 网络系统中日志的管理方法和装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080162601A1 (en) * 2006-12-28 2008-07-03 International Business Machines Corporation Scan-free archiving
CN105005528A (zh) * 2015-06-26 2015-10-28 浪潮(北京)电子信息产业有限公司 一种日志信息提取方法及装置
CN107870842A (zh) * 2016-09-28 2018-04-03 平安科技(深圳)有限公司 一种日志管理方法及系统
CN107451034A (zh) * 2017-08-17 2017-12-08 浪潮软件股份有限公司 一种大数据集群日志管理装置、方法及系统
CN107819616A (zh) * 2017-10-30 2018-03-20 杭州安恒信息技术有限公司 自动提取日志的方法、装置及系统
CN110377481A (zh) * 2019-06-19 2019-10-25 深圳壹账通智能科技有限公司 日志管理方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN110377481A (zh) 2019-10-25
CN110377481B (zh) 2022-06-28

Similar Documents

Publication Publication Date Title
WO2020253125A1 (zh) 日志管理方法、装置、设备及存储介质
WO2021012481A1 (zh) 系统性能监控方法、装置、设备及存储介质
WO2020233077A1 (zh) 系统服务的监控方法、装置、设备及存储介质
WO2018214320A1 (zh) 数据库业务逻辑监控方法、系统、及存储介质
WO2018120681A1 (zh) 数据同步方法、装置、系统、数据处理服务器和存储介质
WO2018166099A1 (zh) 信息泄露检测方法及装置、服务器及计算机可读存储介质
WO2020147385A1 (zh) 数据录入方法、装置、终端及计算机可读存储介质
WO2020107756A1 (zh) 信贷反欺诈方法、系统、设备及计算机可读存储介质
WO2010062063A2 (ko) 브라우저 기반 어뷰징 방지 방법 및 시스템
WO2022050652A1 (en) Method, apparatus, and computer readable storage medium for controlling account
WO2017111197A1 (ko) 학습 분석에서 빅데이터 시각화 시스템 및 방법
WO2020052247A1 (zh) 网络资源批量加载方法、智能电视、存储介质及装置
EP2885758A1 (en) Method and electronic device for editing content
WO2021003956A1 (zh) 产品信息的管理方法、装置、设备及存储介质
WO2018166098A1 (zh) 数据稽核方法、装置、移动终端及计算机可读存储介质
WO2020177376A1 (zh) 数据的提取方法、装置、终端及计算机可读存储介质
WO2020062615A1 (zh) 显示面板的伽马值调节方法、装置及显示设备
WO2018076863A1 (zh) 数据存储的方法、装置、存储介质、服务器及系统
WO2020114333A1 (zh) 基于视频的ar教育方法、智能电视、存储介质及设备
WO2017185647A1 (zh) 基于SoftSIM的IMSI号码管理及呼叫方法、服务器及网络侧设备
WO2018076811A1 (zh) 数据分享方法、装置、存储介质及电子设备
WO2018076890A1 (zh) 数据备份的方法、装置、存储介质、服务器及系统
WO2019223600A1 (zh) 蓝牙音频传输方法、装置及计算机可读存储介质
WO2020073615A1 (zh) 设备软件的升级方法、数据转化器及可读存储介质
WO2013129804A1 (ko) 무선 네트워크 부하 저감 정책 분석 방법 및 시스템과 기록매체

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19933973

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19933973

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 310322)

122 Ep: pct application non-entry in european phase

Ref document number: 19933973

Country of ref document: EP

Kind code of ref document: A1