Unlock instant, AI-driven research and patent intelligence for your innovation.

Log collection method and device, equipment and medium

A collection method and collection device technology, applied in the computer field, can solve the problems of log collection tools such as single function, inflexible use, and low intelligence, and achieve the effect of high collection efficiency, powerful functions, and simple configuration

Active Publication Date: 2021-04-20
FUJIAN NEWLAND SOFTWARE ENGINEERING CO LTD
View PDF6 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0010] The technical problem to be solved by the present invention is to provide a log collection method, device, equipment and medium to solve the shortcomings of existing log collection tools such as single function, poor performance, low intelligence, inflexible use and difficult maintenance

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Log collection method and device, equipment and medium
  • Log collection method and device, equipment and medium
  • Log collection method and device, equipment and medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0046] Such as figure 1 As shown, this embodiment provides a log collection method, including a collection process, the collection process includes the following steps:

[0047] S11, scan the log file under the specified directory every once in a while, after scanning to have the log file under the directory, set up a file read handle to the log file;

[0048] S12. Adjust the starting position of this reading according to the reading progress, and read the content of the log file from the starting position until the last line; specifically: the last time of the log file recorded according to the Meta file Read the content and line number to compare the latest content and line number of the log file, check the last reading progress, and adjust the starting position of this reading according to the following conditions according to the inspection result:

[0049] If the log content is only added, the starting position is the line next to the end line number of the last collecti...

Embodiment 2

[0065] Such as image 3 As shown, a log collection device (or collector) is provided in this embodiment, including:

[0066] The file scanner is used to scan the log files in the specified directory every once in a while. When the log files are found in the directory, a file read handle is established for the log files;

[0067] A file reader, configured to adjust the starting position of this reading according to the reading progress, and read the content of the log file from the starting position until the last line;

[0068] The log parser is used to parse the read content according to the customized parsing rules; the parsing rules currently support three parsing rules: kv, split, and regex, and reserve a custom parsing interface; it can be filtered according to the log level and can be merged Exception stack log content, multiple lines are combined into one line of output, which is convenient for users to view stack information to locate problems;

[0069] The log outpu...

Embodiment 3

[0098] This embodiment provides an electronic device, such as Figure 5 As shown, it includes a memory, a processor, and a computer program stored in the memory and operable on the processor. When the processor executes the computer program, any implementation manner in Embodiment 1 can be realized.

[0099] Since the electronic device introduced in this embodiment is the device used to implement the method in Embodiment 1 of this application, based on the method described in Embodiment 1 of this application, those skilled in the art can understand the electronic device of this embodiment. Specific implementation methods and various variations thereof, so how the electronic device implements the method in the embodiment of the present application will not be described in detail here. As long as a person skilled in the art implements the equipment used by the method in the embodiment of the present application, it all belongs to the protection scope of the present application. ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention provides a log collection method and device, equipment and a medium, and the method comprises the steps: S11, scanning a log file under a specified directory at set intervals, and building a file reading handle for the log file after the log file under the directory is scanned; S12, adjusting the initial position of the current reading according to the reading progress, and reading the content of the log file from the initial position until the last row; S13, analyzing the read content according to a customized analysis rule; S14, outputting the analyzed log content to a configured target output component according to each channel; and S15, monitoring and counting the log offset and the log file number of each channel in real time. Therefore, the defects that an existing log collection tool is single in function, poor in performance, low in intelligent degree, inflexible to use, not easy to maintain and the like are overcome.

Description

technical field [0001] The present invention relates to the field of computer technology, in particular to a log collection method, device, equipment and medium. Background technique [0002] With the development of Internet technology, the original stand-alone has developed into multiple machines and then to large-scale clusters, such as nginx, tomcat, openStack, docker containers, etc., a system is composed of a large number of services, among which the log analysis and management of applications / services in the cluster is also becoming more and more important. A cloud service platform such as the Paas platform manages thousands of applications and services, and each application and service generates thousands of rows or more logs every day. The collection, cleaning, parsing, storage, and Query becomes extremely difficult, and it is particularly important to use a solution that enables stable collection, flexible analysis, organized storage, and convenient query. There a...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F16/17G06F16/13G06F16/14G06F16/16G06F11/14
Inventor 宋云静陈晨
Owner FUJIAN NEWLAND SOFTWARE ENGINEERING CO LTD