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

A log collection method, device, device and medium

A collection method and log technology, which is applied in the computer field, can solve the problems of log collection tools such as single function, inflexible use, and difficult maintenance, and achieve the effect of high collection efficiency, powerful functions, and convenient maintenance

Active Publication Date: 2022-08-05
FUJIAN NEWLAND SOFTWARE ENGINEERING CO LTD
View PDF6 Cites 0 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
  • A log collection method, device, device and medium
  • A log collection method, device, device and medium
  • A log collection method, device, device and medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

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

[0047] S11. Go to the specified directory to scan log files every once in a while, and after scanning a log file in the directory, create a file read handle for the log file;

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

[0049] If the log content is only newly added, the starting position is the next line of the last collected end line number;

[0050] If the...

Embodiment 2

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

[0066] The file scanner is used to scan log files in the specified directory at regular intervals. After scanning the log files in the directory, create a file read handle for the log files;

[0067] A file reader, used to adjust the starting position of the current reading according to the reading progress, and read the contents 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 of kv, split, and regex, and a custom parsing interface is reserved; it can be filtered according to the log level, and can be merged Exception stack log content, combine multiple lines into one line for output, which is convenient for users to view stack information to locate problems;

[0069] The log outputter is us...

Embodiment 3

[0098] This embodiment provides an electronic device, such as Figure 5 As shown, a memory, a processor, and a computer program stored in the memory and running on the processor are included. When the processor executes the computer program, any implementation manner of the first embodiment can be implemented.

[0099] Since the electronic device introduced in this embodiment is the device used to implement the method in the first embodiment of the present application, based on the method introduced in the first embodiment of the present application, those skilled in the art can understand the electronic device in this embodiment. The specific implementation manner and various modifications thereof, so how the electronic device implements the methods in the embodiments of the present application will not be described in detail here. As long as the devices used by those skilled in the art to implement the methods in the embodiments of the present application fall within the sco...

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 present invention provides a log collection method, device, equipment and medium. The method includes a collection process: S11. Go to a specified directory to scan log files at regular intervals, and after scanning to find that there are log files in the directory The log file establishes a file read handle; S12, adjust the starting position of the current reading according to the reading progress, and read the content of the log file from the starting position, until the last line; S13, according to the customized Parse the rules to parse the read content; S14. Output the parsed log content to the configured target output component according to each channel; S15. Real-time monitoring and statistics of the log offset and number of log files for each channel . This solves the shortcomings of the existing log collection tools, such as single function, poor performance, low intelligence, inflexible use and difficult maintenance.

Description

technical field [0001] The present invention relates to the field of computer technology, and in particular, to a log collection method, device, device and medium. Background technique [0002] With the development of Internet technology, the original single machine has developed to multiple machines and then to large-scale clusters, such as nginx, tomcat, openStack, docker containers, etc. A system consists of a large number of services, among which the log analysis and management of applications / services in the cluster also becoming more and more important. Cloud service platforms such as the Paas platform manage thousands of applications and services, each of which generates thousands of lines or more of logs every day. These logs are collected, cleaned, parsed, stored, Querying becomes extremely difficult, and it becomes particularly important to use a solution that can stably collect, flexibly parse, store in an organized manner, and facilitate querying. There are alr...

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 Patents(China)
IPC IPC(8): G06F16/17G06F16/13G06F16/14G06F16/16G06F11/14
Inventor 宋云静陈晨
Owner FUJIAN NEWLAND SOFTWARE ENGINEERING CO LTD