CN108595315B - Log collection method, device and equipment - Google Patents

Log collection method, device and equipment Download PDF

Info

Publication number
CN108595315B
CN108595315B CN201810240536.9A CN201810240536A CN108595315B CN 108595315 B CN108595315 B CN 108595315B CN 201810240536 A CN201810240536 A CN 201810240536A CN 108595315 B CN108595315 B CN 108595315B
Authority
CN
China
Prior art keywords
target log
configuration file
acquisition
log
target
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201810240536.9A
Other languages
Chinese (zh)
Other versions
CN108595315A (en
Inventor
李龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Advanced New Technologies Co Ltd
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 Advanced New Technologies Co Ltd filed Critical Advanced New Technologies Co Ltd
Priority to CN201810240536.9A priority Critical patent/CN108595315B/en
Publication of CN108595315A publication Critical patent/CN108595315A/en
Application granted granted Critical
Publication of CN108595315B publication Critical patent/CN108595315B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring
    • G06F11/3476Data logging

Abstract

The embodiment of the specification discloses a log collection method, a log collection device and log collection equipment. The method comprises the steps of establishing acquisition configuration files of target logs to be acquired in advance, forming a queue, then sequentially calling the configuration files in the queue, acquiring the target logs according to the configuration files in a specified time slice, ending the acquisition immediately after the time length is up, and updating positions to be acquired in the configuration files. Then, the next acquisition profile is called and acquisition continues to be performed under the specified time slice.

Description

Log collection method, device and equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a log collection method, device and apparatus.
Background
During application use, it is often necessary to collect logs of applications for query.
Large-scale distributed systems are widely used today, which typically collect logs of multiple applications simultaneously, for servers dedicated to collecting application logs. The current method for collecting multiple application logs is generally "a log collection scheduling policy of first come and first serve", or "a scheduling policy of polling multiple independent threads".
Based on this, a more convenient log collection scheme is needed.
Disclosure of Invention
The embodiment of the specification provides a log collection method, a log collection device and log collection equipment, which are used for solving the following problems: to provide a more convenient log collection scheme.
Based on this, an embodiment of the present specification provides a log collection method, including:
sequentially calling a target log acquisition configuration file from a pre-established acquisition configuration file queue, wherein the target log acquisition configuration file comprises a target log identifier and a position to be acquired;
and executing log collection operation according to the target log identification and the position to be collected contained in the target log collection configuration file within a specified time slice aiming at any called target log collection configuration file.
Meanwhile, an embodiment of the present specification further provides a log collecting device, including:
the file transferring module is used for sequentially transferring a target log collecting configuration file from a pre-established collecting configuration file queue, wherein the target log collecting configuration file comprises a target log identifier and a position to be collected;
and the acquisition execution module executes log acquisition operation according to the target log identification and the position to be acquired contained in the target log acquisition configuration file within a specified time slice aiming at any called target log acquisition configuration file.
Correspondingly, an embodiment of the present specification further provides a log collecting device, including:
the memory stores a log acquisition program;
the processor calls the log collection program in the memory and executes:
sequentially calling a target log acquisition configuration file from a pre-established acquisition configuration file queue, wherein the target log acquisition configuration file comprises a target log identifier and a position to be acquired;
and executing log collection operation according to the target log identification and the position to be collected contained in the target log collection configuration file within a specified time slice aiming at any called target log collection configuration file.
Correspondingly, embodiments of the present specification also provide a non-volatile computer storage medium storing computer-executable instructions configured to:
sequentially calling a target log acquisition configuration file from a pre-established acquisition configuration file queue, wherein the target log acquisition configuration file comprises a target log identifier and a position to be acquired;
and executing log collection operation according to the target log identification and the position to be collected contained in the target log collection configuration file within a specified time slice aiming at any called target log collection configuration file.
The embodiment of the specification adopts at least one technical scheme which can achieve the following beneficial effects:
the method comprises the steps of establishing a collection configuration file of a target log to be collected in advance, forming a queue, then sequentially calling the configuration file, collecting the target log according to the configuration file in a specified time slice, ending the collection immediately after the time length is up, and updating a position to be collected in the configuration file. Then, the next acquisition profile is called and acquisition continues to be performed under the specified time slice. By the scheduling mode based on the time slice, all the configuration files have the opportunity of being scheduled to run, fair acquisition of all the target logs is guaranteed, the phenomenon that a certain target log occupies system resources for a long time is avoided, and extra system resource overhead is not needed.
Drawings
Fig. 1 is a schematic flowchart of a log collection method provided in an embodiment of the present disclosure;
fig. 2 is a schematic diagram of an acquisition profile queue and a target log acquisition profile provided in an embodiment of the present disclosure;
FIG. 3 is a diagram illustrating an example of a process for scheduling a configuration file queue according to an embodiment of the present disclosure;
fig. 4 is a schematic architecture diagram of a log collection processing flow provided in an embodiment of the present specification;
fig. 5 is a schematic structural diagram of a log collection device provided in an embodiment of this specification.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments in the present specification without any inventive step are within the scope of the present application.
In the current application using process, the application is generally based on a large-scale distributed system, wherein a large number of machines are required to collect thousands of log data every day, and due to the maturity of virtualization technology, logs of multiple applications may be collected on one machine at the same time. Currently, there are two general ways to collect logs:
1, a log collection scheduling strategy of first come and first served. The method comprises the steps of providing a queue, sequentially putting files into a scheduling queue according to the sequence of log file changes, scheduling and distributing a log collection processor for execution according to the sequence of the files entering the queue. The files which enter the queue firstly can share the processor resource, so that under the condition of a single thread, once one file is struggled with the processor resource, the file can run all the time until the file is changed and the processing is finished, and when a certain file generates logs rapidly and uninterruptedly, the phenomenon that other log files cannot be acquired and processed and are starved occurs.
And 2, a scheduling strategy of polling by a plurality of independent threads. The method creates a single thread for processing each collected log file object, and in one processing thread, the log file change is polled regularly to collect and process the log files. For example, open source products logstack, fluent and nxlog generally adopt a plurality of independent threads for log collection. When a server needs to collect a large number of log files, a very large number of log analysis processing threads are occupied, a large amount of overhead is caused to an inner core, context switching between threads also has a large influence on program efficiency, and under a scene of log sparsity, most threads are in an idle state, so that the resource utilization rate is low.
Based on this, the present specification provides a log collection scheme, which reads and collects target logs based on a time slice scheduling method, ensures fair collection of all target logs, avoids a phenomenon that a certain target log occupies system resources for a long time, and does not need additional system resource overhead.
Fig. 1 is a schematic flow chart of a log collection method provided in an embodiment of the present specification, which specifically includes the following steps:
s101, sequentially calling a target log acquisition configuration file from a pre-established acquisition configuration file queue, wherein the target log acquisition configuration file comprises a target log identifier and a position to be acquired.
As described above, the target logs to be collected generally have a plurality of target logs, based on which, we use a collection profile queue to control the execution operation of the collected target logs, each target log has a corresponding target log collection profile in the queue, and implement fair collection of the target logs by maintaining the target log collection profiles, as shown in fig. 2, fig. 2 is a schematic diagram of the collection profile queue and the target log collection profiles provided in this embodiment of the present disclosure.
The target log collection configuration file includes at least two parts: target log identification and a position to be collected. The target log id may be a specific target log name, for example, "xx _ app.log", or may be a code number having a correspondence, for example, "1", where "1" points to "xx _ app.log" through a correspondence table. The location to be collected may be a specific location in the target log, for example, beginning with the first letter of line 9 of the target log; it may be a position offset, for example, the offset is "0 x 11" with respect to the starting position of the target log.
It should be noted that, in the queue file, the target log identifiers included in all the target log collection configuration files are unique, and there are no two identical target log identifiers, so that the target logs can be determined in a one-to-one correspondence manner according to the configuration files, or the log collection configuration files can be determined according to the target log identifiers, so as to execute related operations. In addition, when the target log collection configuration files in the queue file are called, the target log collection configuration files are not called in sequence, as long as the probability that each file is called is ensured to be the same, so that fair collection reading of each target log file is realized, and the mode of calling in sequence is simplest under the principle.
S103, aiming at any called target log collection configuration file, executing log collection operation according to the target log identification and the position to be collected contained in the target log collection configuration file within a specified time slice.
Time slices are the time that the system allocates to each process to allow execution. On the basis of the configuration file queue, the log collection processing time is specified (for example, each time slice is set to be 100 milliseconds, that is, the time allowed to be executed for each target log configuration file is 100 milliseconds), and the system sequentially traverses each element in the configuration file queue to perform collection processing on the corresponding target log. And for the target log corresponding to each configuration file in the file queue, each acquisition and processing occupies at most one time slice of the system. If the target log finishes the acquisition processing in advance in a time slice, resources are immediately and actively released, otherwise, the use right of the configuration file for the system resources is deprived after the time slice, and the next ready target log acquisition configuration file is scheduled to start to perform acquisition. In the above-mentioned collection process, the collection position of the target log is given by the position to be collected in the configuration file. The collection operation is generally to read an external target log file to obtain specific content thereof. For the initial position to be collected, an appropriate assignment may be performed according to actual needs when the configuration file is created, for example, it is desirable to set the position to be collected (offset from the starting position of the target log) to "0" for the target log to be collected from the beginning.
According to the scheme, the acquisition configuration files of the target logs to be acquired are established in advance and form a queue, then the configuration files are sequentially called, the target logs are acquired according to the configuration files in a specified time slice, the acquisition is immediately finished when the time length is up, and the positions to be acquired are updated in the configuration files. Then, the next acquisition profile is called and acquisition continues to be performed under the specified time slice. By the scheduling mode based on the time slice, all the configuration files have the opportunity of being scheduled to run, fair acquisition of all the target logs is guaranteed, the phenomenon that a certain target log occupies system resources for a long time is avoided, and extra system resource overhead is not needed.
As a specific implementation manner, for performing the log collection operation according to the target log identifier and the to-be-collected position contained in the time slice specified in S103, the following manner may be adopted: within a specified time slice, starting from the position to be collected, executing collection operation on the target log (namely, the log corresponding to the target log identifier); determining the acquisition interruption position of the acquisition operation when the time slice is finished; and updating the position to be acquired in the target log acquisition configuration file according to the acquisition interruption position so as to continuously acquire the target log from the acquisition interruption position when the target log is called next time.
Specifically, within a time slice, target logs are read, which may be completely read for smaller target logs, and typically only a portion of target logs that have larger variations or that continue to produce log variations. When the time slice length is one, the reading is finished, and the acquisition is interrupted. When the configuration file of the target log is scheduled next time, the reading from the interrupted reading place is required to be continued, so that the interrupted reading position is required to be saved, namely, the position to be read is updated according to the interrupted position. In general, the address or offset of the interrupt location is directly assigned to the location to be read. For example, for the target log, in the reading, the offset is read to be "0 x 01" relative to the starting position, that is, the value is given to the position to be read, so that in the next scheduling, the offset is calculated according to the value of the position to be read, and the reading position is determined. By determining the value of the position to be read according to the interrupt position, the reading of the same target file can be ensured to be continuous and effective, and the reading cannot be repeated.
In addition, as a specific implementation manner, the collecting configuration file for the target log may further include: and processing the state identification. The processing state identification may have two corresponding values for characterizing the target log collection state: characterizing the value to be processed and characterizing the processed value. For example, representing that the acquisition of the target log is completed and the processing is completed by using '0'; and (3) representing that the target log changes and needs to be acquired by using '1', or representing that the acquisition is not complete and needs to be continuously acquired to be processed. It will be readily appreciated that the characterization values herein may be in other forms of representation. It is only necessary that the system can recognize two corresponding values, which may also be, for example, corresponding values such as "T" or "F", "Y" or "N", and so on.
Therefore, the judgment can be carried out in advance according to the characteristic value of the processing state identifier. If the representation value of the processing state identifier in the target log collection configuration file is '0', the file can be skipped quickly without executing operation on the target log, or the target log collection configuration file is deleted, so that the scheduling of other target logs is accelerated. And when the representation value of the processing state identifier in the target log acquisition configuration file is '1', continuously executing acquisition operation on the target log according to the position to be processed. By setting a characteristic value for the target log in the configuration file, the configuration files of the log files which are processed or not processed can be quickly ignored or deleted, so that system resources can be more effectively saved during sequential scheduling, and the reading efficiency is improved.
In practical application, the characteristic value of the processing state identifier in the above scheme may be preset as follows: receiving a target log file change message carrying a target log identifier; inquiring whether a target log acquisition configuration file containing the same target log identification exists in the acquisition configuration file queue, and if so, setting a representation value of a processing state identification in the target log acquisition configuration file containing the same target log identification as a value to be processed; and if the target log is not existed, creating a target log acquisition configuration file containing the target log identifier into the configuration file queue, wherein in the created target log acquisition configuration file, the representation value of the processing state identifier is set as a value representing to-be-processed.
Specifically, the target log file change message only needs to notify which target log has changed, and does not need to notify the content of the specific change. Taking the example that "0" represents processed and "1" represents pending, when the system receives a change message, it will first determine whether the target log id exists in the configuration file queue: if the target log does not exist, a target log collection configuration file is newly built into a file queue, and a state processing identifier is set to be 1; if so, the status process flag of the target log collection profile is set to "1".
In addition, for the characteristic value of the processing state identifier in the above scheme, the characteristic value may be generated as follows: determining whether all the target logs are completely collected within a specified time slice; if yes, setting the representation value of the processing state identifier as a processed representation value; if not, setting the representation value of the processing state identifier as a value representing to-be-processed.
That is, within the time slice, if the current target log processing is finished (that is, all the current logs are collected), the reference count is modified to be "0", otherwise, the count is kept to be "1", and meanwhile, the current processing position is recorded, and the processing is continued when the next scheduling comes. As shown in fig. 3, fig. 3 is a diagram of an example of scheduling processing of a configuration file queue provided in an embodiment of this specification, in this example, a system schedules and finishes reading a target log "3. log" in a time slice, modifies a characteristic value of a processing state identifier of the system from "1" to "0", and continues to schedule a next target log collection configuration file to read the target log "4. log". When the acquisition configuration file of the target log 3.log is read next time, the configuration file of the target log 3 can be ignored or deleted according to the state representation value 0.
After the log is collected, because the scheme provided in the embodiment of the present specification performs discontinuous collection according to the time slice, further classification and archiving of the collected target log information (i.e., specific change content) may be performed according to the target log identifier in the configuration file, and subsequent services such as monitoring or report display may be performed according to the archived content. As shown in fig. 4, fig. 4 is a schematic diagram of an architecture involved in a log collection processing flow provided in an embodiment of the present disclosure.
Based on the same idea, the present invention further provides a log collecting device, as shown in fig. 5, where fig. 5 is a schematic structural diagram of the log collecting device provided in the embodiment of this specification, and the log collecting device includes:
the file transferring module 501 sequentially transfers a target log collection configuration file from a collection configuration file queue established in advance, wherein the target log collection configuration file comprises a target log identifier and a position to be collected;
the acquisition execution module 503 is configured to execute, within a specified time slice, a log acquisition operation according to the target log identifier and the to-be-acquired position included in any of the retrieved target log acquisition configuration files.
Further, the acquisition execution module 503 executes acquisition operation on the target log from the position to be acquired within a specified time slice; determining the acquisition interruption position of the acquisition operation when the time slice is finished; and updating the position to be acquired in the target log acquisition configuration file according to the acquisition interruption position so as to continuously acquire the target log from the acquisition interruption position when the target log is called next time.
Further, the target log collection configuration file further includes: processing the state identifier; the device further comprises a determining module 505, which determines to execute a deleting operation on the target log collection configuration file according to the processed value represented by the processing state identifier; or determining to execute log collection operation on the target log according to the value representing the to-be-processed of the processing state identifier.
Further, the device also comprises a first assignment module 507 for receiving a target log file change message carrying a target log identifier; inquiring whether a target log acquisition configuration file containing the same target log identification exists in the acquisition configuration file queue; if the target log identification exists, setting the representation value of the processing state identification in the target log collection configuration file containing the same target log identification as a value representing to-be-processed; and if the target log is not existed, creating a target log acquisition configuration file containing the target log identifier into the configuration file queue, wherein in the created target log acquisition configuration file, the representation value of the processing state identifier is set as a value representing to-be-processed.
Further, the apparatus further includes a second assignment module 509, which determines whether all the target logs are completely collected within a specified time slice; if yes, setting the representation value of the processing state identifier as a processed representation value; if not, setting the representation value of the processing state identifier as a value representing to-be-processed.
Further, the apparatus further includes a classifying and archiving module 511, which classifies and archives the acquired target log information according to the target log identifier.
Correspondingly, an embodiment of the present application further provides a log collecting device, including:
the memory stores a log acquisition program;
the processor calls the log collection program in the memory and executes:
sequentially calling a target log acquisition configuration file from a pre-established acquisition configuration file queue, wherein the target log acquisition configuration file comprises a target log identifier and a position to be acquired;
and executing log collection operation according to the target log identification and the position to be collected contained in the target log collection configuration file within a specified time slice aiming at any called target log collection configuration file.
Based on the same inventive concept, embodiments of the present application further provide a corresponding non-volatile computer storage medium, in which computer-executable instructions are stored, where the computer-executable instructions are configured to:
sequentially calling a target log acquisition configuration file from a pre-established acquisition configuration file queue, wherein the target log acquisition configuration file comprises a target log identifier and a position to be acquired;
and executing log collection operation according to the target log identification and the position to be collected contained in the target log collection configuration file within a specified time slice aiming at any called target log collection configuration file.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. Especially, as for the device, apparatus and medium type embodiments, since they are basically similar to the method embodiments, the description is simple, and the related points may refer to part of the description of the method embodiments, which is not repeated here.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps or modules recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Hardware Description Language), traffic, pl (core universal Programming Language), HDCal (jhdware Description Language), lang, Lola, HDL, laspam, hardward Description Language (vhr Description Language), vhal (Hardware Description Language), and vhigh-Language, which are currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functions of the units may be implemented in the same software and/or hardware or in one or more pieces of software and/or hardware when implementing the embodiments of the present description.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include transitory computer readable media (transient media) such as modulated data signal numbers and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, one or more embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein.
Embodiments of the present description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular transactions or implement particular abstract data types. Embodiments of the present description may also be practiced in distributed computing environments where transactions are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.

Claims (11)

1. A log collection method, comprising:
sequentially calling a target log acquisition configuration file from a pre-established acquisition configuration file queue, wherein the target log acquisition configuration file comprises a target log identifier and a position to be acquired, and the position to be acquired is a specific position in the target log;
aiming at any called target log acquisition configuration file, within a specified time slice, starting from the position to be acquired, and executing acquisition operation on the target log;
determining the acquisition interruption position of the acquisition operation when the time slice is finished;
and updating the position to be acquired in the target log acquisition configuration file according to the acquisition interruption position so as to continuously acquire the target log from the acquisition interruption position when the target log is called next time.
2. The method of claim 1, the target log collection profile further comprising: processing the state identifier;
before executing the log collection operation according to the target log identification and the position to be collected, the method further comprises the following steps:
determining to execute deletion operation on the target log acquisition configuration file according to the processed value represented by the processing state identifier; alternatively, the first and second electrodes may be,
and determining to execute log collection operation on the target log according to the value representing the to-be-processed of the processing state identifier.
3. The method of claim 2, wherein the value indicative of the processing state identifier is predetermined by:
receiving a target log file change message carrying a target log identifier;
inquiring whether a target log acquisition configuration file containing the same target log identification exists in the acquisition configuration file queue, and if so, setting a representation value of a processing state identification in the target log acquisition configuration file containing the same target log identification as a value to be processed;
and if the target log is not existed, creating a target log acquisition configuration file containing the target log identifier into the configuration file queue, wherein in the created target log acquisition configuration file, the representation value of the processing state identifier is set as a value representing to-be-processed.
4. The method of claim 2, wherein the value indicative of the processing state identifier is determined by:
determining whether all the target logs are completely collected within a specified time slice;
if yes, setting the representation value of the processing state identifier as a processed representation value;
if not, setting the representation value of the processing state identifier as a value representing to-be-processed.
5. The method of claim 1, further comprising;
and classifying and archiving the acquired target log information according to the target log identification.
6. A log collection apparatus, comprising:
the file transferring module is used for sequentially transferring a target log collecting configuration file from a pre-established collecting configuration file queue, wherein the target log collecting configuration file comprises a target log identifier and a position to be collected, and the position to be collected is a specific position in the target log;
the acquisition execution module is used for acquiring a configuration file aiming at any called target log and executing acquisition operation on the target log from the position to be acquired within a specified time slice; determining the acquisition interruption position of the acquisition operation when the time slice is finished; and updating the position to be acquired in the target log acquisition configuration file according to the acquisition interruption position so as to continuously acquire the target log from the acquisition interruption position when the target log is called next time.
7. The apparatus of claim 6, the target log collection profile further comprising: processing the state identifier; the device also comprises a determining module, which determines to execute deleting operation on the target log acquisition configuration file according to the processed value represented by the processing state identifier; or determining to execute log collection operation on the target log according to the value representing the to-be-processed of the processing state identifier.
8. The apparatus of claim 6, further comprising a first assignment module that receives a target log file change message carrying a target log identifier; inquiring whether a target log acquisition configuration file containing the same target log identification exists in the acquisition configuration file queue; if the target log identification exists, setting the representation value of the processing state identification in the target log collection configuration file containing the same target log identification as a value representing to-be-processed; and if the target log is not existed, creating a target log acquisition configuration file containing the target log identifier into the configuration file queue, wherein in the created target log acquisition configuration file, the representation value of the processing state identifier is set as a value representing to-be-processed.
9. The apparatus of claim 6, further comprising a second valuation module: determining whether all the target logs are completely collected within a specified time slice; if so, setting the representation value of the processing state identifier as a value representing the processed state; if not, setting the representation value of the processing state identifier as a value representing to-be-processed.
10. The apparatus of claim 6, further comprising a classification and archiving module that classifies and archives the collected target log information based on the target log identification.
11. A log collection device, comprising:
the memory stores a log acquisition program;
the processor calls the log collection program in the memory and executes:
sequentially calling a target log acquisition configuration file from a pre-established acquisition configuration file queue, wherein the target log acquisition configuration file comprises a target log identifier and a position to be acquired, and the position to be acquired is a specific position in the target log;
aiming at any called target log acquisition configuration file, within a specified time slice, starting from the position to be acquired, and executing acquisition operation on the target log; determining the acquisition interruption position of the acquisition operation when the time slice is finished; and updating the position to be acquired in the target log acquisition configuration file according to the acquisition interruption position so as to continuously acquire the target log from the acquisition interruption position when the target log is called next time.
CN201810240536.9A 2018-03-22 2018-03-22 Log collection method, device and equipment Active CN108595315B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810240536.9A CN108595315B (en) 2018-03-22 2018-03-22 Log collection method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810240536.9A CN108595315B (en) 2018-03-22 2018-03-22 Log collection method, device and equipment

Publications (2)

Publication Number Publication Date
CN108595315A CN108595315A (en) 2018-09-28
CN108595315B true CN108595315B (en) 2022-03-04

Family

ID=63627066

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810240536.9A Active CN108595315B (en) 2018-03-22 2018-03-22 Log collection method, device and equipment

Country Status (1)

Country Link
CN (1) CN108595315B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110083509B (en) * 2019-04-30 2022-09-20 新华三信息安全技术有限公司 Method and device for arranging log data
CN110908870B (en) * 2019-11-28 2023-11-21 中国银行股份有限公司 Method and device for monitoring resources of mainframe, storage medium and equipment
CN111475390A (en) * 2020-04-01 2020-07-31 深圳Tcl数字技术有限公司 Log collection system deployment method, device, equipment and storage medium

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102073683A (en) * 2010-12-22 2011-05-25 四川大学 Distributed real-time news information acquisition system
CN102158355A (en) * 2011-03-11 2011-08-17 广州蓝科科技股份有限公司 Log event correlation analysis method and device capable of concurrent and interrupted analysis
CN103346902A (en) * 2013-06-19 2013-10-09 北京华胜天成科技股份有限公司 Method and system for data collection and scheduling
CN104461845A (en) * 2014-11-17 2015-03-25 中国航天科工集团第二研究院七〇六所 Self-adaption method of thread pool of log collection system
CN105005618A (en) * 2015-07-21 2015-10-28 杭州合众数据技术有限公司 Data synchronization method and system among heterogeneous databases
CN105045905A (en) * 2015-08-07 2015-11-11 北京思特奇信息技术股份有限公司 Log maintenance method and system based on full-text retrieval
CN105589856A (en) * 2014-10-21 2016-05-18 阿里巴巴集团控股有限公司 Log data processing method and log data processing system
US9361203B2 (en) * 2010-03-31 2016-06-07 Cloudera, Inc. Collecting and aggregating log data with fault tolerance
CN106095864A (en) * 2016-06-03 2016-11-09 中国工商银行股份有限公司 A kind of log processing system and method
CN106357426A (en) * 2016-08-26 2017-01-25 东北大学 Large-scale distribution intelligent data collection system and method based on industrial cloud
CN106789303A (en) * 2016-12-29 2017-05-31 北京奇艺世纪科技有限公司 A kind of container log collection method and device

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9361203B2 (en) * 2010-03-31 2016-06-07 Cloudera, Inc. Collecting and aggregating log data with fault tolerance
CN102073683A (en) * 2010-12-22 2011-05-25 四川大学 Distributed real-time news information acquisition system
CN102158355A (en) * 2011-03-11 2011-08-17 广州蓝科科技股份有限公司 Log event correlation analysis method and device capable of concurrent and interrupted analysis
CN103346902A (en) * 2013-06-19 2013-10-09 北京华胜天成科技股份有限公司 Method and system for data collection and scheduling
CN105589856A (en) * 2014-10-21 2016-05-18 阿里巴巴集团控股有限公司 Log data processing method and log data processing system
CN104461845A (en) * 2014-11-17 2015-03-25 中国航天科工集团第二研究院七〇六所 Self-adaption method of thread pool of log collection system
CN105005618A (en) * 2015-07-21 2015-10-28 杭州合众数据技术有限公司 Data synchronization method and system among heterogeneous databases
CN105045905A (en) * 2015-08-07 2015-11-11 北京思特奇信息技术股份有限公司 Log maintenance method and system based on full-text retrieval
CN106095864A (en) * 2016-06-03 2016-11-09 中国工商银行股份有限公司 A kind of log processing system and method
CN106357426A (en) * 2016-08-26 2017-01-25 东北大学 Large-scale distribution intelligent data collection system and method based on industrial cloud
CN106789303A (en) * 2016-12-29 2017-05-31 北京奇艺世纪科技有限公司 A kind of container log collection method and device

Also Published As

Publication number Publication date
CN108595315A (en) 2018-09-28

Similar Documents

Publication Publication Date Title
CN107402824B (en) Data processing method and device
CN107391526B (en) Data processing method and device based on block chain
CN106802826B (en) Service processing method and device based on thread pool
CN109582466B (en) Timed task execution method, distributed server cluster and electronic equipment
CN107391527B (en) Data processing method and device based on block chain
CN109104327B (en) Service log generation method, device and equipment
CN108595315B (en) Log collection method, device and equipment
CN108845876B (en) Service distribution method and device
CN110716813A (en) Data stream processing method and device, readable storage medium and processor
CN112748993A (en) Task execution method and device, storage medium and electronic equipment
CN106648839B (en) Data processing method and device
CN110807013A (en) Data migration method and device for distributed data storage cluster
CN109766167B (en) Method, device, system and equipment for distributing timed tasks
CN111273965A (en) Container application starting method, system and device and electronic equipment
CN108446301B (en) Business file splitting and summarizing method, device and equipment
CN114115016A (en) Data processing method, device, equipment and medium
CN110083602B (en) Method and device for data storage and data processing based on hive table
CN113032119A (en) Task scheduling method and device, storage medium and electronic equipment
CN111782409A (en) Task processing method, risk identification task processing device and electronic equipment
CN112416534A (en) Agent-based task management method and device
CN110908429B (en) Timer operation method and device
CN111489202B (en) Method and device for sending electronic ticket
CN110633321B (en) Data synchronization method, device and equipment
CN110032433B (en) Task execution method, device, equipment and medium
CN112579305A (en) Task processing method and device, nonvolatile storage medium and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20201028

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20201028

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Applicant before: Alibaba Group Holding Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant