WO2020029376A1 - 日志采集方法、系统、计算机设备和存储介质 - Google Patents

日志采集方法、系统、计算机设备和存储介质 Download PDF

Info

Publication number
WO2020029376A1
WO2020029376A1 PCT/CN2018/106405 CN2018106405W WO2020029376A1 WO 2020029376 A1 WO2020029376 A1 WO 2020029376A1 CN 2018106405 W CN2018106405 W CN 2018106405W WO 2020029376 A1 WO2020029376 A1 WO 2020029376A1
Authority
WO
WIPO (PCT)
Prior art keywords
log
log collection
server
software
configuration information
Prior art date
Application number
PCT/CN2018/106405
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 WO2020029376A1 publication Critical patent/WO2020029376A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0643Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • H04L9/3239Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions involving non-keyed hash functions, e.g. modification detection codes [MDCs], MD5, SHA or RIPEMD

Definitions

  • the present application relates to the field of computer communication technology, and in particular, to a method, a system, a computer device, and a storage medium for collecting logs.
  • the Flume-OG collection framework is also a three-layer state log collection system. There are three layers of agent, collector, and store. The agent is responsible for reading, the collector is collecting and filtering, and the store is the storage layer. At the same time, the load is provided by zookeeper, which makes it more secure compared to the previous two frameworks.
  • the framework is too redundant, it is not very convenient to operate and the development workload is huge.
  • the three existing log collection frameworks cannot achieve large-scale log collection in a distributed environment.
  • a log collection method includes:
  • the log collection software sends an HTTP request for obtaining log configuration information to a server, and the server receives the HTTP request from the log configuration preset in the unified log management platform and then sends the log configuration information to the server.
  • the log collection software, the log collection software generates a log collection configuration file according to the log configuration information, and reloads the log collection process to apply the log collection configuration file for log collection, and the server is set in the Within the unified log management platform;
  • this application also provides a log collection system, including:
  • the installation unit is configured to classify the target server by a unified log management platform and set a label for the target server of the same type, and the unified log management platform sends log collection software to the target server in batches according to the label. After the target server receives it, install the log collection software;
  • the collecting unit is configured to send an HTTP request for obtaining log configuration information to the server by the log collecting software, and the server retrieves the logs from the log configuration preset in the unified log management platform after receiving the HTTP request.
  • the log collection software After the configuration information is sent to the log collection software, the log collection software generates a log collection configuration file according to the log configuration information, and reloads the log collection process to apply the log collection configuration file for log collection, the service
  • the terminal is set in the unified log management platform;
  • the judging unit is configured so that the log collection software sends an HTTP message to the server by calling a log status reporting function preset in the log collection software, where the HTTP message includes a hash value, and the service
  • the terminal determines whether the log collection process is normal according to the hash value. If it is determined that the log collection process is normal, it continues to collect logs. If it is determined that the log collection process is abnormal, the server collects data from the log configuration center. Re-obtain log configuration information, and send the log configuration information to the log collection software, and the log collection software regenerates a log collection configuration file according to the log configuration information, and applies the log collection process by reloading the log collection process Log collection configuration file for log collection.
  • the present application also provides a computer device including a memory and a processor.
  • the memory stores computer-readable instructions.
  • the processing causes the processing.
  • the processor performs the following steps:
  • the unified log management platform classifies the target server and sets a label for the target server of the same type.
  • the unified log management platform sends log collection software to the target server in batches according to the label. Installing the log collection software;
  • the present application also provides a storage medium storing computer-readable instructions.
  • the computer-readable instructions When the computer-readable instructions are executed by one or more processors, the one or more processors execute the following steps:
  • the unified log management platform classifies the target server and sets a label for the target server of the same type.
  • the unified log management platform sends log collection software to the target server in batches according to the label. Installing the log collection software;
  • the log collection software sends an HTTP message to the server by invoking a log status reporting function preset in the log collection software, where the HTTP message includes a hash value, and the server end according to the hash Value to determine whether the log collection process is normal. If it is determined that the log collection process is normal, log collection is continued. If it is determined that the log collection process is abnormal, the server re-obtains log configuration information from the log configuration set. And sending the log configuration information to the log collection software, and the log collection software regenerates a log collection configuration file according to the log configuration information, and applies the log collection configuration file by reloading the log collection process, For log collection.
  • This technical solution realizes large-scale collection of logs in a distributed environment by calling log collection software, and uses a hash value to detect whether the log collection process is normal, improves the efficiency of collecting large-scale logs in a distributed environment, and reduces manual operations. cost.
  • FIG. 1 is a flowchart of a log collection method according to an embodiment of the present application
  • FIG. 1 is a flowchart of a log collection method according to an embodiment of the present application. As shown in FIG. 1, the log collection method specifically includes the following steps:
  • Step S1 The unified log management platform classifies the target server and sets a label for the target server of the same type.
  • the unified log management platform sends log collection software to the target server in batches according to the label.
  • the target server After receiving and installing the log collection software;
  • the method includes:
  • the unified log management platform classifies the target server according to the application IT system name to which the target server belongs, and sets the application IT system name to a label of the same type of target server.
  • the unified log management platform configures the deployment program by calling Send the log collection software to the target server in batches, the target server receives the log collection software through a data interface, and automatically installs the log collection software by calling the installation software set in the target server, the configuration
  • the deployment program is set on the unified log management platform, and the log collection software has a log reporting function.
  • the installation software includes 360 software steward, which is a tool provided by 360 security guards that integrates software download, update, uninstall, and optimization.
  • Software submitted by the software manufacturer to the 360 Security Center is announced after being reviewed by 360 staff. When these software updates are made, 360 users can update to the latest version in the first time.
  • the target server can automatically install the log collection software by calling the 360 software housekeeper.
  • the application IT system includes a plurality of the target servers, and the unified log management platform sets a label for the target server according to the name of the application IT system, and the label is used to indicate the same type of target server.
  • the unified log management platform sends a batch of log collection software to the target server by invoking a configuration and deployment program provided in the unified log management platform, the target server receives the log collection software through a data interface, and 360 software housekeeper in the target server realizes automatic installation of the log collection software.
  • the log collection software sends an HTTP request to the server to obtain log configuration information, and the HTTP request includes a log collection node ID;
  • the server After receiving the HTTP request, the server retrieves log configuration information consistent with the ID of the log collection node from a log configuration set preset in the unified log management platform, where the log configuration information includes The file path of the log, the method of collecting logs, and the addition of field information, the server calculates a hash value by invoking an MD5 value algorithm preset in the server according to the log configuration information, and the hash value Put into a memory for storage, and the server feeds back the log configuration information and the hash value to the log collection software;
  • the log collection software After the log collection software receives the log configuration information, the log collection software generates a log collection configuration file according to a file path of the log to be collected, a log collection method, and additional fields included in the log configuration information. Load a log collection process to apply the log collection file for log collection, and at the same time, the log collection software saves the hash value to a buffer.
  • the storage includes NAS storage, DAS storage, or SAN storage.
  • the storage is selected as a NAS storage.
  • the NAS storage Network Attached Storage
  • the NAS storage is a specialized data storage server, which is based on data and completely separates the storage device from the server. Centralize data management to free up bandwidth, improve performance, reduce total cost of ownership, and protect investment.
  • the server stores the hash value by calling the NAS memory.
  • the buffer includes Redis.
  • the Redis is an open source high-performance key-value storage system written in ANSI C language, supporting network, memory-based and persistent, and can provide APIs in multiple languages.
  • the log collection software saves the hash value by calling the Redis.
  • the MD5 value algorithm (Message Digest Algorithm MD5) is a hash function widely used in the field of computer security to provide message integrity protection, has high compression, easy calculation, resistance to modification, and Strong anti-collision and other advantages.
  • Step S3 The log collection software sends an HTTP message to the server by invoking a function of reporting the log status preset in the log collection software.
  • the HTTP message includes a hash value, and the server receives The hash value is used to determine whether the log collection process is normal. If it is determined that the log collection process is normal, log collection is continued. If it is determined that the log collection process is abnormal, the server obtains it again from the log configuration set. Log configuration information, and send the log configuration information to the log collection software, the log collection software regenerates a log collection configuration file according to the log configuration information, and applies the log collection by reloading the log collection process Configuration file for log collection.
  • the server determining whether the log collection process is normal according to the hash value includes:
  • the log collection software sends an HTTP message to the server according to a preset time interval by invoking a function of reporting a log status preset in the log collection software, and the HTTP message includes a log collection node ID
  • the server detects the log collection process according to the hash value. If the hash value is consistent with the hash value stored in the memory of the server , The log collection is continued. If the hash value is not consistent with the hash value stored in the memory of the server, the server collects the node ID from the log according to the log collection node ID included in the HTTP message.
  • the log configuration centrally retrieves the corresponding log configuration information, and sends the log configuration information to the log collection software.
  • the log collection software regenerates a log collection configuration file according to the log configuration information, and reloads the log by A collection process to apply the log collection configuration file to perform log collection.
  • the preset time interval includes a time interval of every minute or every hour. In this embodiment, the preset time interval is set to an interval of one minute.
  • the hash value also called a hash function
  • the hash function compresses the message or data into a digest, which reduces the amount of data and fixes the data format.
  • the hash function scrambles the data and recreates a fingerprint called a hash value.
  • the hash value is usually represented by a short string of random letters and numbers.
  • the server determines whether the log collection process is normal according to the hash value. If the hash value is consistent with the hash value stored in the memory of the server, the log collection is continued.
  • the hash value is inconsistent with the hash value stored in the memory of the server, the server collects the corresponding log configuration from the log configuration set according to the log collection node ID contained in the HTTP message Information, and send the log configuration information to the log collection software, and the log collection software regenerates a log collection configuration file according to the log configuration information, and applies the log collection configuration file by reloading the log collection process For log collection.
  • the unified log management platform sets a tag for the same type of target server, and sends log collection software to the target server in batches according to the label.
  • the target server receives the log collection software and installs it; the log collection The software sends an HTTP request to the server.
  • the server retrieves the log configuration information from the log configuration set.
  • the log collection software generates a log collection file according to the log configuration information, and reloads the log collection.
  • This technical solution realizes large-scale collection of logs in a distributed environment by calling log collection software, and uses a hash value to detect whether the log collection process is normal, improves the efficiency of collecting large-scale logs in a distributed environment, and reduces manual operations. cost.
  • an embodiment of the present application further provides a log collection system.
  • the system includes an installation unit, a collection unit, and a judgment unit.
  • the installation unit is configured to classify the target server by a unified log management platform, and set a label for the target server of the same type, and the unified log management platform sends log collection software to the target server in batches according to the label. After the target server receives and installs the log collection software;
  • the installation unit sets a label for the same type of target server through a unified log management platform, and sends log collection software to the target server in batches according to the label.
  • the target server receives the log collection software for installation
  • the collection unit sends an HTTP request to a server through the log collection software, and after receiving the HTTP request, the server retrieves log configuration information from a log configuration centrally, and the log collection software according to the log configuration information Generating a log collection file, and reloading the log collection process to apply the log collection configuration file for log collection;
  • the judging unit sends an HTTP message to the server through the log collection software by calling a log status reporting function,
  • the HTTP message contains a hash value, and it is determined whether the log collection process is normal according to the hash value.
  • the installation unit is further configured to classify the target server according to the application IT system name to which the target server belongs, and set the application IT system name to the same type of target server.
  • the unified log management platform sends a batch of log collection software to the target server by invoking a configuration deployment program, the target server receives the log collection software through a data interface, and calls the installation set in the target server.
  • the software automatically installs the log collection software, the configuration and deployment program is set on the unified log management platform, and the log collection software has a log reporting function.
  • the sending request module is configured to send the log collection software to the server an HTTP request for obtaining log configuration information, where the HTTP request includes a log collection node ID;
  • the feedback module is configured to, after the server receives the HTTP request, retrieve log configuration information consistent with the log collection node ID from a log configuration set preset in the unified log management platform, and the log configuration
  • the information includes a file path of a log to be collected, a log collection method, and additional field information.
  • the server calculates a hash value by invoking an MD5 value algorithm preset in the server according to the log configuration information, and Storing the hash value in a memory for storage, and the server feeding back the log configuration information and the hash value to the log collection software;
  • the log collection module is configured to generate a log collection configuration file according to a file path of a log to be collected, a log collection method, and an additional field included in the log configuration information after the log collection software receives the log configuration information.
  • the log collection software applies the log collection file for log collection by reloading the log collection process, and at the same time, the log collection software saves the hash value to a buffer.
  • the judging unit is further configured that the log collection software sends an HTTP report to the server according to a preset time interval by invoking a log status reporting function preset in the log collection software.
  • the HTTP message includes information including the ID of the log collection node and the hash value.
  • the server After receiving the HTTP message, the server detects the log collection process based on the hash value. If the hash value and the If the hash value stored in the memory of the server is consistent, log collection is continued.
  • the server is based on the The log collection node ID contained in the HTTP message, the corresponding log configuration information is retrieved from the log configuration set, and the log configuration information is sent to the log collection software, and the log collection software is based on the The log configuration information regenerates a log collection configuration file, and the log collection configuration file is reloaded to apply the log collection configuration file for log collection.
  • the installation software includes 360 software steward.
  • the storage includes NAS storage, DAS storage, or SAN storage
  • the buffer includes Redis.
  • the preset time interval includes a time interval of every minute or every hour.
  • the present application also proposes a computer device including a memory, a processor, and computer-readable instructions stored on the memory and executable on the processor, the processing When the processor executes the computer-readable instructions, the steps in the log collection method in the foregoing embodiments are implemented.
  • the present application also provides a storage medium storing computer-readable instructions.
  • the computer-readable instructions are executed by one or more processors, the one or more processors execute the foregoing implementations.
  • the computer program may be stored in a computer-readable storage medium.
  • the foregoing storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (Random Access Memory, RAM).

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Power Engineering (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Debugging And Monitoring (AREA)

Abstract

一种日志采集方法、系统、计算机设备和存储介质,该方法包括:通过统一日志管理平台为目标服务器设置标签,并批量发送日志采集软件,目标服务器接收日志采集软件后进行安装;日志采集软件向服务端发送HTTP请求,服务端从日志配置集中调取日志配置信息,日志采集软件根据日志配置信息生成日志采集文件,通过重新加载日志采集进程来应用日志采集配置文件,进行日志采集;日志采集软件通过调用日志状态上报功能向服务端发送HTTP报文,根据HTTP报文中含有hash值来判断日志采集进程是否正常。本技术方案通过调用日志采集软件实现在分布式环境中大规模采集日志,并利用hash值来检测日志采集进程是否正常,降低了人工操作成本。

Description

日志采集方法、系统、计算机设备和存储介质
本申请要求于2018年08月08日提交中国专利局、申请号为201810894320.4、发明名称为“日志采集方法、系统、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机通信技术领域,特别是涉及日志采集方法、系统、计算机设备和存储介质。
背景技术
日志采集是指对各个系统和应用程序产生log文件进行采集,log文件包含了当前的程序的运行状态,报错信息和用户的操作信息等。目前日志采集方法和系统包括基于Scribe的采集框架,Chukwa的采集框架和Flume-OG采集框架。
Scribe的采集框架是从各个源将日志采集后集中存储到一个中央存储系统,然后进行集中的统计分析,由于agent和collector之间没有响应的容错机制,易出现数据丢失情况,同时,Scribe的采集框架是基于thrift,依赖较为复杂,环境的侵入性比较强。Chukwa的采集框架主要是针对各种数据的采集,它包含了很多强大和灵活的工具集,并且能同时分析采集到的数据,其扩展性好。较之于Scribe的采集框架,Chukwa的采集框架能够定期记录已发送的数据来提供容错机制,和hadoop的集成性高,但由于Chukwa的采集框架版本较新,并且设计的主要初衷是为了各种数据的采集,导致在日志采集上并没有什么具体的商业扩产。Flume-OG采集框架也是一种三层状态的日志采集系统,agent、collector和store三层结构,其中agent负责读取,collector负责采集过滤,store是存储层。同时,通过zookeeper来提供负载,使得相对于前两种框架更为安全,然而由于框架过于冗杂,操作起来不是很方便,开发工作量巨大。此外,现有的三种日志采集框架无法实现在分布式环境中,大规模采集日志。
发明内容
基于此,有必要针对在进行日志采集时,无法实现在分布式环境中大规模采集日志等问题,提供了日志采集方法、系统、计算机设备和存储介质。
一种日志采集方法,包括:
统一日志管理平台对目标服务器进行分类,并为同一类所述目标服务器设置一标签,所述统一日志管理平台根据所述标签向所述目标服务器批量发送日志采集软件,所述目标服务器接收后并安装所述日志采集软件;
所述日志采集软件向服务端发送获取日志配置信息的HTTP请求,所述服务端接收所述HTTP请求后从预设在所述统一日志管理平台内的日志配置集中调取日志配置信息后发送给所述日志采集软件,所述日志采集软件根据所述日志配置信息生成日志采集配置文件,通过重新加载日志采集进程来应用所述日志采集配置文件,进行日志采集,所述服务端设置在所述统一日志管理平台内;
所述日志采集软件通过调用预设在所述日志采集软件内的日志状态上报功能向所述服务端发送HTTP报文,所述HTTP报文中包含有hash值,所述服务端根据所述hash值来判断日志采集进程是否正常,若判断所述日志采集进程正常,则继续进行日志采集,若判断所述日志采集进程出现异常,所述服务端则从所述日志配置集中重新获取日志配置信息,并将所述日志配置信息发送给所述日志采集软件,所述日志采集软件则根据所述日志配置信息重新生成日志采集配置文件,通过重新加载日志采集进程来应用所述日志采集配置文件,以进行日志采集。
基于相同的技术构思,本申请还提供一种日志采集系统,包括:
安装单元,设置为统一日志管理平台对目标服务器进行分类,并为同一类所述目标服务器设置一标签,所述统一日志管理平台根据所述标签向所述目标服务器批量发送日志采集软件,所述目标服务器接收后并安装所述日志采集软件;
采集单元,设置为所述日志采集软件向服务端发送获取日志配置信息的HTTP请求,所述服务端接收所述HTTP请求后从预设在所述统一日志管理平台内的日志配置集中调取日志配置信息后发送给所述日志采集软件,所述日志采集 软件根据所述日志配置信息生成日志采集配置文件,通过重新加载日志采集进程来应用所述日志采集配置文件,进行日志采集,所述服务端设置在所述统一日志管理平台内;
判断单元,设置为所述日志采集软件通过调用预设在所述日志采集软件内的日志状态上报功能向所述服务端发送HTTP报文,所述HTTP报文中包含有hash值,所述服务端根据所述hash值来判断日志采集进程是否正常,若判断所述日志采集进程正常,则继续进行日志采集,若判断所述日志采集进程出现异常,所述服务端则从所述日志配置集中重新获取日志配置信息,并将所述日志配置信息发送给所述日志采集软件,所述日志采集软件则根据所述日志配置信息重新生成日志采集配置文件,通过重新加载日志采集进程来应用所述日志采集配置文件,以进行日志采集。
基于相同的技术构思,本申请还提供一种计算机设备,包括存储器和处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行以下步骤:
统一日志管理平台对目标服务器进行分类,并为同一类所述目标服务器设置一标签,所述统一日志管理平台根据所述标签向所述目标服务器批量发送日志采集软件,所述目标服务器接收后并安装所述日志采集软件;
所述日志采集软件向服务端发送获取日志配置信息的HTTP请求,所述服务端接收所述HTTP请求后从预设在所述统一日志管理平台内的日志配置集中调取日志配置信息后发送给所述日志采集软件,所述日志采集软件根据所述日志配置信息生成日志采集配置文件,通过重新加载日志采集进程来应用所述日志采集配置文件,进行日志采集,所述服务端设置在所述统一日志管理平台内;
所述日志采集软件通过调用预设在所述日志采集软件内的日志状态上报功能向所述服务端发送HTTP报文,所述HTTP报文中包含有hash值,所述服务端根据所述hash值来判断日志采集进程是否正常,若判断所述日志采集进程正常,则继续进行日志采集,若判断所述日志采集进程出现异常,所述服务端则从所述日志配置集中重新获取日志配置信息,并将所述日志配置信息发送给所述日志采集软件,所述日志采集软件则根据所述日志配置信息重新生成日志采集配 置文件,通过重新加载日志采集进程来应用所述日志采集配置文件,以进行日志采集。
基于相同的技术构思,本申请还提供一种存储有计算机可读指令的存储介质,所述计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:
统一日志管理平台对目标服务器进行分类,并为同一类所述目标服务器设置一标签,所述统一日志管理平台根据所述标签向所述目标服务器批量发送日志采集软件,所述目标服务器接收后并安装所述日志采集软件;
所述日志采集软件向服务端发送获取日志配置信息的HTTP请求,所述服务端接收所述HTTP请求后从预设在所述统一日志管理平台内的日志配置集中调取日志配置信息后发送给所述日志采集软件,所述日志采集软件根据所述日志配置信息生成日志采集配置文件,通过重新加载日志采集进程来应用所述日志采集配置文件,进行日志采集,所述服务端设置在所述统一日志管理平台内;
所述日志采集软件通过调用预设在所述日志采集软件内的日志状态上报功能向所述服务端发送HTTP报文,所述HTTP报文中包含有hash值,所述服务端根据所述hash值来判断日志采集进程是否正常,若判断所述日志采集进程正常,则继续进行日志采集,若判断所述日志采集进程出现异常,所述服务端则从所述日志配置集中重新获取日志配置信息,并将所述日志配置信息发送给所述日志采集软件,所述日志采集软件则根据所述日志配置信息重新生成日志采集配置文件,通过重新加载日志采集进程来应用所述日志采集配置文件,以进行日志采集。
上述日志采集方法、系统、计算机设备和存储介质,通过统一日志管理平台为同一类目标服务器设置标签,并根据所述标签向所述目标服务器批量发送日志采集软件,所述目标服务器接收所述日志采集软件后进行安装;所述日志采集软件向服务端发送HTTP请求,所述服务端接收所述HTTP请求后,从日志配置集中调取日志配置信息,所述日志采集软件根据所述日志配置信息生成日志采集文件,通过重新加载日志采集进程来应用所述日志采集配置文件,进行日志采集;所述日志采集软件通过调用日志状态上报功能向所述服务端发送 HTTP报文,所述HTTP报文中含有hash值,根据所述hash值来判断日志采集进程是否正常。本技术方案通过调用日志采集软件实现在分布式环境中大规模采集日志,并利用hash值来检测日志采集进程是否正常,提高了在分布式环境中对大规模日志的采集效率,降低了人工操作成本。
附图说明
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本申请的限制。
图1为本申请一个实施例中一种日志采集方法的流程图;
图2为本申请一个实施例中一种日志采集系统的示意图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本技术领域技术人员可以理解,除非特意声明,这里使用的单数形式“一”、“一个”、“所述”和“该”也可以包括复数形式。应该进一步理解的是,本申请的说明书中使用的措辞“包括”是指存在所述特征、程序、步骤、操作、元件和/或组件,但是并不排除存在或添加一个或多个其他特征、程序、步骤、操作、元件、组件和/或它们的组。
图1为本申请一个实施例中一种日志采集方法的流程图,如图1所示,所述日志采集方法,具体包括如下步骤:
步骤S1:统一日志管理平台对目标服务器进行分类,并为同一类所述目标服务器设置一标签,所述统一日志管理平台根据所述标签向所述目标服务器批量发送日志采集软件,所述目标服务器接收后并安装所述日志采集软件;
本实施例中,所述目标服务器接收后并安装所述日志采集软件包括:
统一日志管理平台按照目标服务器所隶属的应用IT系统名称对所述目标服 务器进行分类,并将所述应用IT系统名称设置为同一类目标服务器的标签,所述统一日志管理平台通过调用配置部署程序向所述目标服务器批量发送日志采集软件,所述目标服务器通过数据接口接收所述日志采集软件,通过调用设置在所述目标服务器内的安装软件对所述日志采集软件进行自动安装,所述配置部署程序设置在所述统一日志管理平台上,所述日志采集软件具有日志上报功能。
本实施例中,所述安装软件包括360软件管家,所述360软件管家是360安全卫士中提供的一个集软件下载、更新、卸载、优化于一体的工具。由软件厂商主动向360安全中心提交的软件,经360工作人员审核后公布,这些软件更新时360用户能在第一时间内更新到最新版本。本实施例中,所述目标服务器通过调用所述360软件管家能够实现对所述日志采集软件的自动安装。
本实施例中,所述日志上报功能是指日志采集软件按照预设的时间间隔向所述统一日志管理平台内的服务端发送包含有日志采集节点ID、日志采集进程状态在内的HTTP报文。
本实施例中,所述应用IT系统内包含有多个所述目标服务器,统一日志管理平台根据所述应用IT系统的名称为所述目标服务器设置标签,所述标签用于表示同一类目标服务器,所述统一日志管理平台通过调用设置在所述统一日志管理平台内的配置部署程序向所述目标服务器批量发送日志采集软件,所述目标服务器通过数据接口接收所述日志采集软件,通过调用设置在所述目标服务器内的360软件管家,实现对所述日志采集软件的自动安装。
步骤S2:所述日志采集软件向服务端发送获取日志配置信息的HTTP请求,所述服务端接收所述HTTP请求后从预设在所述统一日志管理平台内的日志配置集中调取日志配置信息后发送给所述日志采集软件,所述日志采集软件根据所述日志配置信息生成日志采集配置文件,通过重新加载日志采集进程来应用所述日志采集配置文件,进行日志采集,所述服务端设置在所述统一日志管理平台内。
本实施例中,所述日志采集包括:
所述日志采集软件向所述服务端发送获取日志配置信息的HTTP请求,所述 HTTP请求中包含有日志采集节点ID;
所述服务端接收所述HTTP请求后,从预设在统一日志管理平台内的日志配置集内调取与所述日志采集节点ID相一致的日志配置信息,所述日志配置信息包括需要采集的日志的文件路径、日志采集方法和增加字段信息,所述服务端根据所述日志配置信息,通过调用预设在所述服务端内的MD5值算法计算得出hash值,并将所述hash值放入至一存储器内进行存储,所述服务端将所述日志配置信息和所述hash值反馈至所述日志采集软件;
所述日志采集软件接收所述日志配置信息后,根据所述日志配置信息中包含的需采集的日志的文件路径、日志采集方法和增加字段来生成日志采集配置文件,所述日志采集软件通过重新加载日志采集进程来应用所述日志采集文件,进行日志采集,同时,所述日志采集软件将所述hash值保存至一缓存器内。
本实施例中,所述存储器包括NAS存储器、DAS存储器或SAN存储器。本实施例中,所述存储器选定为NAS存储器,所述NAS存储器(Network Attached Storage:网络附属存储),是一种专门数据存储服务器,是以数据为中心,将存储设备和服务器彻底分离,集中管理数据,从而释放带宽、提高性能、降低总拥有成本、保护投资。本实施例中,所述服务端通过调用所述NAS存储器保存hash值。
所述缓存器包括Redis,所述Redis是一个开源的使用ANSI C语言编写、支持网络、可基于内存亦可持久化的高性能key-value存储系统,并能提供多种语言的API。所述日志采集软件通过调用所述Redis来保存hash值。
本实施例中,所述MD5值算法(Message Digest Algorithm MD5)为计算机安全领域广泛使用的一种散列函数,用以提供消息的完整性保护,具有高压缩性、易于计算、抗修改性和强抗碰撞等优点。
步骤S3:所述日志采集软件通过调用预设在所述日志采集软件内的日志状态上报功能向所述服务端发送HTTP报文,所述HTTP报文中包含有hash值,所述服务端根据所述hash值来判断日志采集进程是否正常,若判断所述日志采集进程正常,则继续进行日志采集,若判断所述日志采集进程出现异常,所述服务端则从所述日志配置集中重新获取日志配置信息,并将所述日志配置信息发 送给所述日志采集软件,所述日志采集软件则根据所述日志配置信息重新生成日志采集配置文件,通过重新加载日志采集进程来应用所述日志采集配置文件,以进行日志采集。
本实施例中,所述服务端根据所述hash值来判断日志采集进程是否正常包括:
所述日志采集软件通过调用预设在所述日志采集软件内的日志状态上报功能,按照预设的时间间隔向所述服务端发送HTTP报文,所述HTTP报文中包含有日志采集节点ID、hash值在内的信息,服务端接收所述HTTP报文后,根据所述hash值对日志采集进程进行检测,若所述hash值与存储在所述服务端中的存储器内的hash值一致,则继续进行日志采集,若所述hash值与存储在所述服务端中的存储器内的hash值不一致,则所述服务端根据所述HTTP报文中所包含的日志采集节点ID,从所述日志配置集中调取对应的日志配置信息,并将所述日志配置信息发送给所述日志采集软件,所述日志采集软件则根据所述日志配置信息重新生成日志采集配置文件,通过重新加载日志采集进程来应用所述日志采集配置文件,以进行日志采集。
本实施例中,所述预设的时间间隔包括以每分钟或每小时为时间间隔,本实施例中,将所述预设的时间间隔设置为间隔一分钟。
本实施例中,所述hash值,又称为散列函数,是一种从任何一种数据中创建小的数字“指纹”的方法。散列函数把消息或数据压缩成摘要,使得数据量变小,将数据格式固定下来。所述散列函数将数据打乱,重新创建一个叫做散列值的指纹。所述散列值通常使用一个短的随机字母和数字组成的字符串来代表。本实施例中,服务端根据所述hash值来判断日志采集进程是否正常,若所述hash值与存储在所述服务端中的存储器内的hash值一致,则继续进行日志采集,若所述hash值与存储在所述服务端中的存储器内的hash值不一致,则所述服务端根据所述HTTP报文中所包含的日志采集节点ID,从所述日志配置集中调取对应的日志配置信息,并将所述日志配置信息发送给所述日志采集软件,所述日志采集软件则根据所述日志配置信息重新生成日志采集配置文件,通过重新加载日志采集进程来应用所述日志采集配置文件,以进行日志采集。
上述实施例,统一日志管理平台为同一类目标服务器设置标签,并根据所述标签向所述目标服务器批量发送日志采集软件,所述目标服务器接收所述日志采集软件后进行安装;所述日志采集软件向服务端发送HTTP请求,所述服务端接收所述HTTP请求后,从日志配置集中调取日志配置信息,所述日志采集软件根据所述日志配置信息生成日志采集文件,通过重新加载日志采集进程来应用所述日志采集配置文件,进行日志采集;所述日志采集软件通过调用日志状态上报功能向所述服务端发送HTTP报文,所述HTTP报文中含有hash值,根据所述hash值来判断日志采集进程是否正常。本技术方案通过调用日志采集软件实现在分布式环境中大规模采集日志,并利用hash值来检测日志采集进程是否正常,提高了在分布式环境中对大规模日志的采集效率,降低了人工操作成本。
基于相同的技术构思,本申请实施例还提供了一种日志采集系统,如图2所示,该系统包括安装单元、采集单元和判断单元;
所述安装单元,设置为统一日志管理平台对目标服务器进行分类,并为同一类所述目标服务器设置一标签,所述统一日志管理平台根据所述标签向所述目标服务器批量发送日志采集软件,所述目标服务器接收后并安装所述日志采集软件;
所述采集单元,设置为所述日志采集软件向服务端发送获取日志配置信息的HTTP请求,所述服务端接收所述HTTP请求后从预设在所述统一日志管理平台内的日志配置集中调取日志配置信息后发送给所述日志采集软件,所述日志采集软件根据所述日志配置信息生成日志采集配置文件,通过重新加载日志采集进程来应用所述日志采集配置文件,进行日志采集,所述服务端设置在所述统一日志管理平台内;
所述判断单元,设置为所述日志采集软件通过调用预设在所述日志采集软件内的日志状态上报功能向所述服务端发送HTTP报文,所述HTTP报文中包含有hash值,所述服务端根据所述hash值来判断日志采集进程是否正常,若判断所述日志采集进程正常,则继续进行日志采集,若判断所述日志采集进程出现异常,所述服务端则从所述日志配置集中重新获取日志配置信息,并将所述日志配置信息发送给所述日志采集软件,所述日志采集软件则根据所述日志配 置信息重新生成日志采集配置文件,通过重新加载日志采集进程来应用所述日志采集配置文件,以进行日志采集。
上述实施例,所述安装单元通过统一日志管理平台为同一类目标服务器设置标签,并根据所述标签向所述目标服务器批量发送日志采集软件,所述目标服务器接收所述日志采集软件后进行安装;所述采集单元通过所述日志采集软件向服务端发送HTTP请求,所述服务端接收所述HTTP请求后,从日志配置集中调取日志配置信息,所述日志采集软件根据所述日志配置信息生成日志采集文件,通过重新加载日志采集进程来应用所述日志采集配置文件,进行日志采集;所述判断单元通过所述日志采集软件通过调用日志状态上报功能向所述服务端发送HTTP报文,所述HTTP报文中含有hash值,根据所述hash值来判断日志采集进程是否正常。本技术方案通过调用日志采集软件实现在分布式环境中大规模采集日志,并利用hash值来检测日志采集进程是否正常,提高了在分布式环境中对大规模日志的采集效率,降低了人工操作成本。
在一个实施例中,所述安装单元,还设置为统一日志管理平台按照目标服务器所隶属的应用IT系统名称对所述目标服务器进行分类,并将所述应用IT系统名称设置为同一类目标服务器的标签,所述统一日志管理平台通过调用配置部署程序向所述目标服务器批量发送日志采集软件,所述目标服务器通过数据接口接收所述日志采集软件,通过调用设置在所述目标服务器内的安装软件对所述日志采集软件进行自动安装,所述配置部署程序设置在所述统一日志管理平台上,所述日志采集软件具有日志上报功能。
在一个实施例中,所述采集单元,包括:
发送请求模块,设置为所述日志采集软件向所述服务端发送获取日志配置信息的HTTP请求,所述HTTP请求中包含有日志采集节点ID;
反馈模块,设置为所述服务端接收所述HTTP请求后,从预设在统一日志管理平台内的日志配置集内调取与所述日志采集节点ID相一致的日志配置信息,所述日志配置信息包括需要采集的日志的文件路径、日志采集方法和增加字段信息,所述服务端根据所述日志配置信息,通过调用预设在所述服务端内的MD5值算法计算得出hash值,并将所述hash值放入至一存储器内进行存储,所述 服务端将所述日志配置信息和所述hash值反馈至所述日志采集软件;
日志采集模块,设置为所述日志采集软件接收所述日志配置信息后,根据所述日志配置信息中包含的需采集的日志的文件路径、日志采集方法和增加字段来生成日志采集配置文件,所述日志采集软件通过重新加载日志采集进程来应用所述日志采集文件,进行日志采集,同时,所述日志采集软件将所述hash值保存至一缓存器内。
在一个实施例中,所述判断单元,还设置为所述日志采集软件通过调用预设在所述日志采集软件内的日志状态上报功能,按照预设的时间间隔向所述服务端发送HTTP报文,所述HTTP报文中包含有日志采集节点ID、hash值在内的信息,服务端接收所述HTTP报文后,根据所述hash值对日志采集进程进行检测,若所述hash值与存储在所述服务端中的存储器内的hash值一致,则继续进行日志采集,若所述hash值与存储在所述服务端中的存储器内的hash值不一致,则所述服务端根据所述HTTP报文中所包含的日志采集节点ID,从所述日志配置集中调取对应的日志配置信息,并将所述日志配置信息发送给所述日志采集软件,所述日志采集软件则根据所述日志配置信息重新生成日志采集配置文件,通过重新加载日志采集进程来应用所述日志采集配置文件,以进行日志采集。
在一个实施例中,所述安装软件包括360软件管家。
在一个实施例中,所述存储器包括NAS存储器、DAS存储器或SAN存储器,所述缓存器包括Redis。
在一个实施例中,所述预设的时间间隔包括以每分钟或每小时为时间间隔。
基于相同的技术构思,本申请还提出了一种计算机设备,所述计算机设备包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现上述各实施例里日志采集方法中的步骤。
基于相同的技术构思,本申请还提供了一种存储有计算机可读指令的存储介质,所述计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行上述各实施例里日志采集方法中的步骤。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,该计算机程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,前述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等非易失性存储介质,或随机存储记忆体(Random Access Memory,RAM)等。
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。

Claims (20)

  1. 一种日志采集方法,包括:
    统一日志管理平台对目标服务器进行分类,并为同一类所述目标服务器设置一标签,所述统一日志管理平台根据所述标签向所述目标服务器批量发送日志采集软件,所述目标服务器接收后并安装所述日志采集软件;
    所述日志采集软件向服务端发送获取日志配置信息的HTTP请求,所述服务端接收所述HTTP请求后从预设在所述统一日志管理平台内的日志配置集中调取日志配置信息后发送给所述日志采集软件,所述日志采集软件根据所述日志配置信息生成日志采集配置文件,通过重新加载日志采集进程来应用所述日志采集配置文件,进行日志采集,所述服务端设置在所述统一日志管理平台内;
    所述日志采集软件通过调用预设在所述日志采集软件内的日志状态上报功能向所述服务端发送HTTP报文,所述HTTP报文中包含有hash值,所述服务端根据所述hash值来判断日志采集进程是否正常,若判断所述日志采集进程正常,则继续进行日志采集,若判断所述日志采集进程出现异常,所述服务端则从所述日志配置集中重新获取日志配置信息,并将所述日志配置信息发送给所述日志采集软件,所述日志采集软件则根据所述日志配置信息重新生成日志采集配置文件,通过重新加载日志采集进程来应用所述日志采集配置文件,以进行日志采集。
  2. 根据权利要求1所述一种日志采集方法,其中,所述目标服务器接收后并安装所述日志采集软件,包括:
    统一日志管理平台按照目标服务器所隶属的应用IT系统名称对所述目标服务器进行分类,并将所述应用IT系统名称设置为同一类目标服务器的标签,所述统一日志管理平台通过调用配置部署程序向所述目标服务器批量发送日志采集软件,所述目标服务器通过数据接口接收所述日志采集软件,通过调用设置在所述目标服务器内的安装软件对所述日志采集软件进行自动安装,所述配置部署程序设置在所述统一日志管理平台上,所述日志采集软件具有日志上报功能。
  3. 根据权利要求1所述一种日志采集方法,其中,所述日志采集,包括:
    所述日志采集软件向所述服务端发送获取日志配置信息的HTTP请求,所述 HTTP请求中包含有日志采集节点ID;
    所述服务端接收所述HTTP请求后,从预设在统一日志管理平台内的日志配置集内调取与所述日志采集节点ID相一致的日志配置信息,所述日志配置信息包括需要采集的日志的文件路径、日志采集方法和增加字段信息,所述服务端根据所述日志配置信息,通过调用预设在所述服务端内的MD5值算法计算得出hash值,并将所述hash值放入至一存储器内进行存储,所述服务端将所述日志配置信息和所述hash值反馈至所述日志采集软件;
    所述日志采集软件接收所述日志配置信息后,根据所述日志配置信息中包含的需采集的日志的文件路径、日志采集方法和增加字段来生成日志采集配置文件,所述日志采集软件通过重新加载日志采集进程来应用所述日志采集文件,进行日志采集,同时,所述日志采集软件将所述hash值保存至一缓存器内。
  4. 根据权利要求1所述一种日志采集方法,其中,所述服务端根据所述hash值来判断日志采集进程是否正常,包括:
    所述日志采集软件通过调用预设在所述日志采集软件内的日志状态上报功能,按照预设的时间间隔向所述服务端发送HTTP报文,所述HTTP报文中包含有日志采集节点ID、hash值在内的信息,服务端接收所述HTTP报文后,根据所述hash值对日志采集进程进行检测,若所述hash值与存储在所述服务端中的存储器内的hash值一致,则继续进行日志采集,若所述hash值与存储在所述服务端中的存储器内的hash值不一致,则所述服务端根据所述HTTP报文中所包含的日志采集节点ID,从所述日志配置集中调取对应的日志配置信息,并将所述日志配置信息发送给所述日志采集软件,所述日志采集软件则根据所述日志配置信息重新生成日志采集配置文件,通过重新加载日志采集进程来应用所述日志采集配置文件,以进行日志采集。
  5. 根据权利要求2所述一种日志采集方法,其中,所述安装软件包括360软件管家。
  6. 根据权利要求3所述一种日志采集方法,其中,所述存储器包括NAS存储器、DAS存储器或SAN存储器;
    所述缓存器包括Redis。
  7. 根据权利要求4所述一种日志采集方法,其中,所述预设的时间间隔包括以每分钟或每小时为时间间隔。
  8. 一种日志采集系统,包括:
    安装单元,设置为统一日志管理平台对目标服务器进行分类,并为同一类所述目标服务器设置一标签,所述统一日志管理平台根据所述标签向所述目标服务器批量发送日志采集软件,所述目标服务器接收后并安装所述日志采集软件;
    采集单元,设置为所述日志采集软件向服务端发送获取日志配置信息的HTTP请求,所述服务端接收所述HTTP请求后从预设在所述统一日志管理平台内的日志配置集中调取日志配置信息后发送给所述日志采集软件,所述日志采集软件根据所述日志配置信息生成日志采集配置文件,通过重新加载日志采集进程来应用所述日志采集配置文件,进行日志采集,所述服务端设置在所述统一日志管理平台内;
    判断单元,设置为所述日志采集软件通过调用预设在所述日志采集软件内的日志状态上报功能向所述服务端发送HTTP报文,所述HTTP报文中包含有hash值,所述服务端根据所述hash值来判断日志采集进程是否正常,若判断所述日志采集进程正常,则继续进行日志采集,若判断所述日志采集进程出现异常,所述服务端则从所述日志配置集中重新获取日志配置信息,并将所述日志配置信息发送给所述日志采集软件,所述日志采集软件则根据所述日志配置信息重新生成日志采集配置文件,通过重新加载日志采集进程来应用所述日志采集配置文件,以进行日志采集。
  9. 根据权利要求8所述一种日志采集系统,其中,所述安装单元,还设置为统一日志管理平台按照目标服务器所隶属的应用IT系统名称对所述目标服务器进行分类,并将所述应用IT系统名称设置为同一类目标服务器的标签,所述统一日志管理平台通过调用配置部署程序向所述目标服务器批量发送日志采集软件,所述目标服务器通过数据接口接收所述日志采集软件,通过调用设置在所述目标服务器内的安装软件对所述日志采集软件进行自动安装,所述配置部署程序设置在所述统一日志管理平台上,所述日志采集软件具有日志上报功能。
  10. 根据权利要求8所述一种日志采集系统,其中,所述采集单元,包括:
    发送请求模块,设置为所述日志采集软件向所述服务端发送获取日志配置信息的HTTP请求,所述HTTP请求中包含有日志采集节点ID;
    反馈模块,设置为所述服务端接收所述HTTP请求后,从预设在统一日志管理平台内的日志配置集内调取与所述日志采集节点ID相一致的日志配置信息,所述日志配置信息包括需要采集的日志的文件路径、日志采集方法和增加字段信息,所述服务端根据所述日志配置信息,通过调用预设在所述服务端内的MD5值算法计算得出hash值,并将所述hash值放入至一存储器内进行存储,所述服务端将所述日志配置信息和所述hash值反馈至所述日志采集软件;
    日志采集模块,设置为所述日志采集软件接收所述日志配置信息后,根据所述日志配置信息中包含的需采集的日志的文件路径、日志采集方法和增加字段来生成日志采集配置文件,所述日志采集软件通过重新加载日志采集进程来应用所述日志采集文件,进行日志采集,同时,所述日志采集软件将所述hash值保存至一缓存器内。
  11. 根据权利要求8所述一种日志采集系统,其中,所述判断单元,还设置为所述日志采集软件通过调用预设在所述日志采集软件内的日志状态上报功能,按照预设的时间间隔向所述服务端发送HTTP报文,所述HTTP报文中包含有日志采集节点ID、hash值在内的信息,服务端接收所述HTTP报文后,根据所述hash值对日志采集进程进行检测,若所述hash值与存储在所述服务端中的存储器内的hash值一致,则继续进行日志采集,若所述hash值与存储在所述服务端中的存储器内的hash值不一致,则所述服务端根据所述HTTP报文中所包含的日志采集节点ID,从所述日志配置集中调取对应的日志配置信息,并将所述日志配置信息发送给所述日志采集软件,所述日志采集软件则根据所述日志配置信息重新生成日志采集配置文件,通过重新加载日志采集进程来应用所述日志采集配置文件,以进行日志采集。
  12. 根据权利要求9所述一种日志采集系统,其中,所述安装软件包括360软件管家。
  13. 根据权利要求10所述一种日志采集系统,其中,所述存储器包括NAS 存储器、DAS存储器或SAN存储器,所述缓存器包括Redis。
  14. 根据权利要求11所述一种日志采集系统,其中,所述预设的时间间隔包括以每分钟或每小时为时间间隔。
  15. 一种计算机设备,包括数据库和处理器,所述数据库中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行以下步骤:
    统一日志管理平台对目标服务器进行分类,并为同一类所述目标服务器设置一标签,所述统一日志管理平台根据所述标签向所述目标服务器批量发送日志采集软件,所述目标服务器接收后并安装所述日志采集软件;
    所述日志采集软件向服务端发送获取日志配置信息的HTTP请求,所述服务端接收所述HTTP请求后从预设在所述统一日志管理平台内的日志配置集中调取日志配置信息后发送给所述日志采集软件,所述日志采集软件根据所述日志配置信息生成日志采集配置文件,通过重新加载日志采集进程来应用所述日志采集配置文件,进行日志采集,所述服务端设置在所述统一日志管理平台内;
    所述日志采集软件通过调用预设在所述日志采集软件内的日志状态上报功能向所述服务端发送HTTP报文,所述HTTP报文中包含有hash值,所述服务端根据所述hash值来判断日志采集进程是否正常,若判断所述日志采集进程正常,则继续进行日志采集,若判断所述日志采集进程出现异常,所述服务端则从所述日志配置集中重新获取日志配置信息,并将所述日志配置信息发送给所述日志采集软件,所述日志采集软件则根据所述日志配置信息重新生成日志采集配置文件,通过重新加载日志采集进程来应用所述日志采集配置文件,以进行日志采集。
  16. 根据权利要求15所述一种计算机设备,其中,所述目标服务器接收后并安装所述日志采集软件时,使得所述处理器执行以下步骤:
    统一日志管理平台按照目标服务器所隶属的应用IT系统名称对所述目标服务器进行分类,并将所述应用IT系统名称设置为同一类目标服务器的标签,所述统一日志管理平台通过调用配置部署程序向所述目标服务器批量发送日志采集软件,所述目标服务器通过数据接口接收所述日志采集软件,通过调用设置 在所述目标服务器内的安装软件对所述日志采集软件进行自动安装,所述配置部署程序设置在所述统一日志管理平台上,所述日志采集软件具有日志上报功能。
  17. 根据权利要求15所述一种计算机设备,其中,所述进行日志采集时,使得所述处理器执行以下步骤:
    所述日志采集软件向所述服务端发送获取日志配置信息的HTTP请求,所述HTTP请求中包含有日志采集节点ID;
    所述服务端接收所述HTTP请求后,从预设在统一日志管理平台内的日志配置集内调取与所述日志采集节点ID相一致的日志配置信息,所述日志配置信息包括需要采集的日志的文件路径、日志采集方法和增加字段信息,所述服务端根据所述日志配置信息,通过调用预设在所述服务端内的MD5值算法计算得出hash值,并将所述hash值放入至一存储器内进行存储,所述服务端将所述日志配置信息和所述hash值反馈至所述日志采集软件;
    所述日志采集软件接收所述日志配置信息后,根据所述日志配置信息中包含的需采集的日志的文件路径、日志采集方法和增加字段来生成日志采集配置文件,所述日志采集软件通过重新加载日志采集进程来应用所述日志采集文件,进行日志采集,同时,所述日志采集软件将所述hash值保存至一缓存器内。
  18. 一种存储有计算机可读指令的存储介质,所述计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:
    统一日志管理平台对目标服务器进行分类,并为同一类所述目标服务器设置一标签,所述统一日志管理平台根据所述标签向所述目标服务器批量发送日志采集软件,所述目标服务器接收后并安装所述日志采集软件;
    所述日志采集软件向服务端发送获取日志配置信息的HTTP请求,所述服务端接收所述HTTP请求后从预设在所述统一日志管理平台内的日志配置集中调取日志配置信息后发送给所述日志采集软件,所述日志采集软件根据所述日志配置信息生成日志采集配置文件,通过重新加载日志采集进程来应用所述日志采集配置文件,进行日志采集,所述服务端设置在所述统一日志管理平台内;
    所述日志采集软件通过调用预设在所述日志采集软件内的日志状态上报功 能向所述服务端发送HTTP报文,所述HTTP报文中包含有hash值,所述服务端根据所述hash值来判断日志采集进程是否正常,若判断所述日志采集进程正常,则继续进行日志采集,若判断所述日志采集进程出现异常,所述服务端则从所述日志配置集中重新获取日志配置信息,并将所述日志配置信息发送给所述日志采集软件,所述日志采集软件则根据所述日志配置信息重新生成日志采集配置文件,通过重新加载日志采集进程来应用所述日志采集配置文件,以进行日志采集。
  19. 根据权利要求18所述一种存储介质,其中,所述目标服务器接收后并安装所述日志采集软件时,使得一个或多个所述处理器执行以下步骤:
    统一日志管理平台按照目标服务器所隶属的应用IT系统名称对所述目标服务器进行分类,并将所述应用IT系统名称设置为同一类目标服务器的标签,所述统一日志管理平台通过调用配置部署程序向所述目标服务器批量发送日志采集软件,所述目标服务器通过数据接口接收所述日志采集软件,通过调用设置在所述目标服务器内的安装软件对所述日志采集软件进行自动安装,所述配置部署程序设置在所述统一日志管理平台上,所述日志采集软件具有日志上报功能。
  20. 根据权利要求18所述一种存储介质,其中,所述进行日志采集时,使得一个或多个所述处理器执行以下步骤:
    所述日志采集软件向所述服务端发送获取日志配置信息的HTTP请求,所述HTTP请求中包含有日志采集节点ID;
    所述服务端接收所述HTTP请求后,从预设在统一日志管理平台内的日志配置集内调取与所述日志采集节点ID相一致的日志配置信息,所述日志配置信息包括需要采集的日志的文件路径、日志采集方法和增加字段信息,所述服务端根据所述日志配置信息,通过调用预设在所述服务端内的MD5值算法计算得出hash值,并将所述hash值放入至一存储器内进行存储,所述服务端将所述日志配置信息和所述hash值反馈至所述日志采集软件;
    所述日志采集软件接收所述日志配置信息后,根据所述日志配置信息中包含的需采集的日志的文件路径、日志采集方法和增加字段来生成日志采集配置 文件,所述日志采集软件通过重新加载日志采集进程来应用所述日志采集文件,进行日志采集,同时,所述日志采集软件将所述hash值保存至一缓存器内。
PCT/CN2018/106405 2018-08-08 2018-09-19 日志采集方法、系统、计算机设备和存储介质 WO2020029376A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810894320.4 2018-08-08
CN201810894320.4A CN109218401B (zh) 2018-08-08 2018-08-08 日志采集方法、系统、计算机设备和存储介质

Publications (1)

Publication Number Publication Date
WO2020029376A1 true WO2020029376A1 (zh) 2020-02-13

Family

ID=64988214

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/106405 WO2020029376A1 (zh) 2018-08-08 2018-09-19 日志采集方法、系统、计算机设备和存储介质

Country Status (2)

Country Link
CN (1) CN109218401B (zh)
WO (1) WO2020029376A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110968478B (zh) * 2019-11-21 2023-04-25 掌阅科技股份有限公司 日志采集方法、服务器及计算机存储介质
CN111367760B (zh) * 2020-02-28 2022-07-19 深圳平安医疗健康科技服务有限公司 日志采集方法及装置、计算机设备、存储介质
CN111475390A (zh) * 2020-04-01 2020-07-31 深圳Tcl数字技术有限公司 日志采集系统部署方法、装置、设备及存储介质
CN117290190B (zh) * 2023-11-27 2024-02-13 博为科技有限公司 一种串口日志远程采集方法、装置及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103178982A (zh) * 2011-12-23 2013-06-26 阿里巴巴集团控股有限公司 日志分析方法和装置
CN104317610A (zh) * 2014-10-11 2015-01-28 福建新大陆软件工程有限公司 一种hadoop平台自动安装部署的方法及装置
CN104486107A (zh) * 2014-12-05 2015-04-01 曙光信息产业(北京)有限公司 一种日志采集装置及方法
CN105278996A (zh) * 2015-11-03 2016-01-27 亚信科技(南京)有限公司 一种日志采集方法、装置及日志服务系统
CN108306771A (zh) * 2018-02-09 2018-07-20 腾讯科技(深圳)有限公司 日志上报方法、装置及系统

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102780726B (zh) * 2011-05-13 2016-12-07 国网山东省电力公司蒙阴县供电公司 一种基于web平台的日志分析方法及系统
CN102946320B (zh) * 2012-10-10 2015-06-24 北京邮电大学 一种分布式用户行为日志预测网络监管方法及系统
CN103617287A (zh) * 2013-12-12 2014-03-05 用友软件股份有限公司 一种分布式环境下的日志管理方法和装置
US10268750B2 (en) * 2016-01-29 2019-04-23 Cisco Technology, Inc. Log event summarization for distributed server system
CN108052675B (zh) * 2017-12-28 2021-04-09 深圳Tcl新技术有限公司 日志管理方法、系统及计算机可读存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103178982A (zh) * 2011-12-23 2013-06-26 阿里巴巴集团控股有限公司 日志分析方法和装置
CN104317610A (zh) * 2014-10-11 2015-01-28 福建新大陆软件工程有限公司 一种hadoop平台自动安装部署的方法及装置
CN104486107A (zh) * 2014-12-05 2015-04-01 曙光信息产业(北京)有限公司 一种日志采集装置及方法
CN105278996A (zh) * 2015-11-03 2016-01-27 亚信科技(南京)有限公司 一种日志采集方法、装置及日志服务系统
CN108306771A (zh) * 2018-02-09 2018-07-20 腾讯科技(深圳)有限公司 日志上报方法、装置及系统

Also Published As

Publication number Publication date
CN109218401B (zh) 2021-08-31
CN109218401A (zh) 2019-01-15

Similar Documents

Publication Publication Date Title
WO2020029376A1 (zh) 日志采集方法、系统、计算机设备和存储介质
CN109120678B (zh) 用于分布式存储系统的服务托管的方法和装置
US10929247B2 (en) Automatic creation of application-centric extended metadata for a storage appliance
WO2020253079A1 (zh) 基于Jmeter的分布式性能测试方法、装置、设备及存储介质
US9361592B2 (en) Automated defect and optimization discovery
US20140108352A1 (en) Retrieving Point-In-Time Copies of a Source Database For Creating Virtual Databases
US10909000B2 (en) Tagging data for automatic transfer during backups
US11663093B2 (en) Automated development of recovery plans
JP2003099410A (ja) 複数装置管理の方法およびシステム
US9058330B2 (en) Verification of complex multi-application and multi-node deployments
US9342390B2 (en) Cluster management in a shared nothing cluster
US20190138375A1 (en) Optimization of message oriented middleware monitoring in heterogenenous computing environments
WO2019223181A1 (zh) Etl任务数据源切换方法、系统、计算机设备和存储介质
EP2438709B1 (en) Network element integration
US10574552B2 (en) Operation of data network
US9443196B1 (en) Method and apparatus for problem analysis using a causal map
US20230409437A1 (en) Tagging writers for incremental backups of system objects
US20230409439A1 (en) Disaster recovery (dr) asset sizing for front end terabyte (fetb) consumption
EP3989053A1 (en) Creation and use of an efficiency set to estimate an amount of data stored in a data set of a storage system having one or more characteristics
EP3993353A2 (en) System and method for managing clusters in an edge network
US11074002B2 (en) Object storage system with meta object replication
JP2007034416A (ja) ログデータを管理する情報処理システム、ログデータ管理方法およびプログラム
US20200272349A1 (en) Information processing system and information processing apparatus
WO2016000137A1 (zh) 一种多站点自动更新方法、客户端和系统
US11994953B2 (en) Memory simulation of agent service for secured restore

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: 18929026

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: 18929026

Country of ref document: EP

Kind code of ref document: A1