CN104967696A - Log sending method and device - Google Patents

Log sending method and device Download PDF

Info

Publication number
CN104967696A
CN104967696A CN201510456900.1A CN201510456900A CN104967696A CN 104967696 A CN104967696 A CN 104967696A CN 201510456900 A CN201510456900 A CN 201510456900A CN 104967696 A CN104967696 A CN 104967696A
Authority
CN
China
Prior art keywords
log
log information
target
sent
daily record
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.)
Pending
Application number
CN201510456900.1A
Other languages
Chinese (zh)
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.)
Secworld Information Technology Beijing Co Ltd
Original Assignee
Secworld Information Technology Beijing 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 Secworld Information Technology Beijing Co Ltd filed Critical Secworld Information Technology Beijing Co Ltd
Priority to CN201510456900.1A priority Critical patent/CN104967696A/en
Publication of CN104967696A publication Critical patent/CN104967696A/en
Pending legal-status Critical Current

Links

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/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3055Monitoring arrangements for monitoring the status of the computing system or of the computing system component, e.g. monitoring if the computing system is on, off, available, not available
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/069Management of faults, events, alarms or notifications using logs of notifications; Post-processing of notifications

Landscapes

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

Abstract

The invention discloses a log sending method and device. The method comprises steps: a log type of a log to be sent is obtained; log information is obtained according to the obtained log type, and the log information is buffered in an object storage space; the log information buffered in the object storage space is read; the read log information is sent to an object server according to a plurality of object paths. The technical problem of low log file sending speed in the prior art is solved.

Description

Log Sender method and apparatus
Technical field
The present invention relates to daily record field tests, in particular to a kind of Log Sender method and apparatus.
Background technology
Along with popularizing of the Internet, the generation of the network equipment miscellaneous result in current network environment and becomes increasingly complex, thus makes information security field institute problems faced also more and more severeer.The daily record amount that our operation system is also subject to thereupon is also increasing, and this has just had higher requirement to the performance of system, in order to meet the demand in market, sending the performance that a large amount of daily records carrys out detection system each side just seem particularly important to system under test (SUT).
The daily record of current employing instrument of giving out a contract for a project has played many effects in log audit, and along with the optimization of system, the continuous lifting of performance index, current instrument of giving out a contract for a project shows certain limitation.When packet sending speed reaches certain quantity, instrument of giving out a contract for a project inherently has a large amount of packet loss phenomenons, thus reduces the operating efficiency of tester.
For above-mentioned problem, at present effective solution is not yet proposed.
Summary of the invention
Embodiments provide a kind of Log Sender method and apparatus, send the slower technical problem of journal file speed at least to solve in prior art.
According to an aspect of the embodiment of the present invention, provide a kind of Log Sender method, comprising: the Log Types obtaining daily record to be sent; According to the log information getting the described daily record to be sent of described Log Types acquisition, and described log information is cached in target storage space; Read the log information being cached in described target storage space; And the described log information read is sent to destination server according to target line, wherein, the quantity of described target line is multiple.
Further, log information according to getting the described daily record to be sent of described Log Types acquisition comprises: judge that described Log Types is the first kind or Second Type, wherein, the described first kind represents that described daily record to be sent is system journal, and described Second Type represents that described daily record to be sent is simple network management daily record; And when judging that described Log Types is the described first kind, reading system log information, or when judging that described Log Types is described Second Type, read simple network management log information.
Further, when judging that described Log Types is the described first kind, reading system log information, or when judging that described Log Types is described Second Type, reading simple network management log information and comprising: the log acquisition mode obtaining described daily record to be sent; Judge that described log acquisition mode is first method or second method, wherein, described first method represents and gets described daily record to be sent in the form of a file, and described second method represents and gets described daily record to be sent with text box form; And when judging that described log acquisition mode is described first method, read the content of the file representing described system log message or described simple network management log information, or when judging that described log acquisition mode is described second method, read the content of the text box representing described system log message or described simple network management log information.
Further, the log information that described Log Types obtains described daily record to be sent is got in basis, and after described log information is cached in target storage space, and before reading is cached in the log information of described target storage space, described method also comprises: determine target send mode, wherein, described target send mode is the send mode sending described log information; And wherein, the described log information read is sent to destination server according to target line and comprises: according to described target send mode, the described log information read is sent to described destination server according to described target line.
Further, described target send mode comprises according to pre-set velocity send mode or according to default total send mode.
Further, the described log information read is sent to destination server according to target line comprise: judge whether to arrange the IP of described destination server and the target port of described destination server, wherein, the quantity of the IP of described destination server is multiple; When judging to arrange described IP and described target port, set up the communication connection of target device and described destination server according to the described IP arranged and described target port, wherein, described target device is the equipment sending described log information; When judging not arrange described IP and described target port, receive described IP and described target port are arranged instruction is set, and the communication connection that described IP set by instruction and described target port set up described target device and described destination server is set according to described; Multiple described target line is created according to the quantity of the described IP arranged or according to according to the described quantity arranging described IP set by instruction; And utilize the multiple described target line created to send described log information to described destination server.
Further, described method also comprises: the statistical information once sending described log information at interval of Preset Time display, wherein, described statistical information comprise following one of at least: accumulative quantity forwarded, this quantity forwarded, actual quantity forwarded and accumulative transmitting time.
According to the another aspect of the embodiment of the present invention, additionally provide a kind of Log Sender device, comprising: the first acquiring unit, for obtaining the Log Types of daily record to be sent; Second acquisition unit, gets for basis the log information that described Log Types obtains described daily record to be sent, and described log information is cached in target storage space; Reading unit, for reading the log information being cached in described target storage space; And transmitting element, for the described log information read is sent to destination server according to target line, wherein, the quantity of described target line is multiple.
Further, described second acquisition unit comprises: the first judge module, for judging that described Log Types is the first kind or Second Type, wherein, the described first kind represents that described daily record to be sent is system journal, and described Second Type represents that described daily record to be sent is simple network management daily record; And read module, for when judging that described Log Types is the described first kind, reading system log information, or when judging that described Log Types is described Second Type, read simple network management log information.
Further, described read module comprises: obtain submodule, for obtaining the log acquisition mode of described daily record to be sent; Judge submodule, for judging that described log acquisition mode is first method or second method, wherein, described first method represents and gets described daily record to be sent in the form of a file, and described second method represents and gets described daily record to be sent with text box form; And reading submodule, for when judging that described log acquisition mode is described first method, read the content of the file representing described system log message or described simple network management log information, or when judging that described log acquisition mode is described second method, read the content of the text box representing described system log message or described simple network management log information.
Further, described device also comprises: determining unit, for obtaining the log information of described daily record to be sent at described second acquisition unit according to getting described Log Types, and after described log information is cached in target storage space, and before described reading unit reading is cached in the log information of described target storage space, determine target send mode, wherein, described target send mode is the send mode sending described log information; And wherein, described transmitting element is used for, according to described target send mode, the described log information read is sent to described destination server according to described target line.
Further, described target send mode comprises according to pre-set velocity send mode or according to default total send mode.
Further, described transmitting element comprises: the second judge module, arranges the IP of described destination server and the target port of described destination server for judging whether, wherein, the quantity of the IP of described destination server is multiple; First sets up module, for when judging to arrange described IP and described target port, set up the communication connection of target device and described destination server according to the described IP arranged and described target port, wherein, described target device is the equipment sending described log information; Receiver module, for when judging not arrange described IP and described target port, receive described IP and described target port are arranged instruction is set; Second sets up module, for arranging according to described the communication connection that described IP set by instruction and described target port set up described target device and described destination server; Creation module, for creating multiple described target line according to the quantity of described IP arranged or according to according to the described quantity arranging described IP set by instruction; And sending module, send described log information to described destination server for utilizing the multiple described target line of establishment.
Further, described device also comprises: display unit, for once sending the statistical information of described log information at interval of Preset Time display, wherein, described statistical information comprise following one of at least: accumulative quantity forwarded, this quantity forwarded, actual quantity forwarded and accumulative transmitting time.
In embodiments of the present invention, have employed the Log Types obtaining daily record to be sent; Obtain log information according to getting Log Types, and log information is cached in target storage space; Read the log information being cached in target storage space; And the log information read is sent to destination server according to target line, wherein, the quantity of target line is multiple modes.By obtaining the Log Types of daily record to be sent, according to the Log Types determined, obtain the log information of respective type, and the respective type log information got is stored in target storage space, when needs send log information, log information to be sent is read to target storage space, log information to be sent is sent to destination server according to multiple target line, reach the object that quantitatively can reach performance test very soon and need, thus achieve the technique effect improving tester's operating efficiency, and then solve in prior art and send the slower technical problem of journal file speed.
Accompanying drawing explanation
Accompanying drawing described herein is used to provide a further understanding of the present invention, and form a application's part, schematic description and description of the present invention, for explaining the present invention, does not form inappropriate limitation of the present invention.In the accompanying drawings:
Fig. 1 is the flow chart of a kind of optional Log Sender method according to the embodiment of the present invention;
Fig. 2 is the hardware topology figure of Log Sender according to the embodiment of the present invention and log acquisition;
Fig. 3 is the flow chart according to the optional Log Sender method of the another kind of the embodiment of the present invention;
Fig. 4 is the flow chart of log acquisition in the Log Sender method according to the embodiment of the present invention;
Fig. 5 is the flow chart of Log Sender in the Log Sender method according to the embodiment of the present invention;
Fig. 6 is the schematic diagram of a kind of optional Log Sender device according to the embodiment of the present invention;
Fig. 7 is the schematic diagram of operation interface in the Log Sender device according to the embodiment of the present invention;
Fig. 8 is the schematic diagram according to operation interface in the optional Log Sender device of the another kind of the embodiment of the present invention;
Fig. 9 is the schematic diagram according to the optional Log Sender device of the another kind of the embodiment of the present invention;
Figure 10 is the schematic diagram of read module in a kind of optional Log Sender device according to the embodiment of the present invention; And
Figure 11 is the schematic diagram of transmitting element in a kind of optional Log Sender device according to the embodiment of the present invention.
Embodiment
The present invention program is understood better in order to make those skilled in the art person, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the embodiment of a part of the present invention, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, should belong to the scope of protection of the invention.
It should be noted that, term " first ", " second " etc. in specification of the present invention and claims and above-mentioned accompanying drawing are for distinguishing similar object, and need not be used for describing specific order or precedence.Should be appreciated that the data used like this can be exchanged in the appropriate case, so as embodiments of the invention described herein can with except here diagram or describe those except order implement.In addition, term " comprises " and " having " and their any distortion, intention is to cover not exclusive comprising, such as, contain those steps or unit that the process of series of steps or unit, method, system, product or equipment is not necessarily limited to clearly list, but can comprise clearly do not list or for intrinsic other step of these processes, method, product or equipment or unit.
According to the embodiment of the present invention, provide a kind of Log Sender embodiment of the method, it should be noted that, can perform in the computer system of such as one group of computer executable instructions in the step shown in the flow chart of accompanying drawing, and, although show logical order in flow charts, in some cases, can be different from the step shown or described by order execution herein.
Fig. 1 is the flow chart of a kind of optional Log Sender method according to the embodiment of the present invention.As shown in Figure 1, the method comprises the steps that S102 is to step S108:
Step S102, obtains the Log Types of daily record to be sent.Particularly, before transmission log information, be provided with Log Types at operation interface, realized the acquisition of Log Types by corresponding computer programming language.
Step S104, according to the log information getting Log Types and obtain daily record to be sent, and is cached in target storage space by log information.
Step S106, reads the log information being cached in target storage space.
Step S108, is sent to destination server by the log information read according to target line, and wherein, the quantity of target line is multiple.Particularly, it is multiple for arranging the target line sending log information, log information is sent to destination server according to multiple target line, improves the transmitting efficiency of daily record.
The Log Sender method that the embodiment of the present invention provides, by obtaining the Log Types of daily record to be sent, according to the Log Types determined, obtain the log information of respective type, and the respective type log information got is stored in target storage space, when needs send log information, log information to be sent is read to target storage space, log information to be sent is sent to destination server according to multiple target line, reach the object that quantitatively can reach performance test very soon and need, thus achieve the technique effect improving tester's operating efficiency, and then solve in prior art and send the slower technical problem of journal file speed.
Fig. 2 is the hardware topology figure of Log Sender according to the embodiment of the present invention and log acquisition.
As shown in Figure 2, hardware topology figure comprises: PC 10, system under test (SUT) server 20, core switch 30 and router and fire compartment wall 40.Particularly, PC 10 comprises the transmission instrument of log information, the transmission instrument of the log information on PC 10 is utilized to obtain the Log Types of the daily record to be sent be provided with, the transmission instrument of the log information on PC 10 obtains corresponding log information according to the Log Types of the daily record to be sent judged, and the log information got is stored in target storage space, target storage space is the memory headroom of the transmission instrument of log information on PC 10.The transmission instrument of the log information on PC 10 is utilized to read the log information be stored in target storage space, and the log information of reading is sent to system under test (SUT) server 20 by core switch 30, wherein, system under test (SUT) server 20 can be multiple servers, also can be a station server.Router and fire compartment wall 40 are mainly for the protection of network.
Fig. 3 is the flow chart according to the optional Log Sender method of the another kind of the embodiment of the present invention, and as shown in Figure 3, the method comprises the steps that S302 is to step S314:
Step S302, obtains the Log Types of daily record to be sent.Particularly, before transmission log information, be provided with Log Types at operation interface, realized the acquisition of Log Types by corresponding computer programming language, identical with step S102.
Step S304, judges that Log Types is the first kind or Second Type, when judging that Log Types is the first kind, performs step S306, otherwise performs step S308.
Step S306, reading system log information.
Step S308, reads simple network management log information.
Step S310, determines target send mode, and wherein, target send mode is the send mode sending log information, and target send mode comprises according to pre-set velocity send mode or according to default total send mode.
Step S312, reads the log information being cached in target storage space, identical with step S106.
Step S314, is sent to destination server by the log information read according to target line, and wherein, the quantity of target line is multiple, identical with step S108.Particularly, it is multiple for arranging the target line sending log information, log information is sent to destination server according to multiple target line, improves the transmitting efficiency of daily record.
The acquisition of log information all completes with transmission in the transmission instrument of log information, and the computer language of employing is Python, runs in Python interpreter, and Python interpreter version can be Python2.7.5.Be elected to after selecting Log Types, need to provide corresponding log information, wherein, comprise two kinds of Log Types, the first kind represents that daily record to be sent is system journal syslog, and Second Type represents that daily record to be sent is simple network management daily record SNMP.The log information of respective type is obtained according to the Log Types judged, after the corresponding Log Types of acquisition, need to determine target send mode, the i.e. send mode of log information, target send mode mainly comprises two kinds, the first is according to pre-set velocity send mode, and the second is according to default total send mode.When selecting according to pre-set velocity send mode, the transmission instrument of log information can send with pre-set velocity always, until user clicks stopping, the transmission instrument of log information stops sending, transmission speed can be set as required, such as can arrange 1000/second, concrete numerical value can be arranged according to specific needs.When selecting according to default total send mode, after the log information quantity of the transmission instrument transmission of log information arrives and arranges sum, the transmission instrument of log information can stop sending log information, and user can arrange as required and send sum, such as, can arrange and send sum 10000 or more.
Fig. 4 is the flow chart of log acquisition in the Log Sender method according to the embodiment of the present invention, and as shown in Figure 4, the method comprises the steps that S402 is to step S408:
Step S402, obtains the log acquisition mode of daily record to be sent.
Step S404, judge that log acquisition mode is first method or second method, wherein, first method represents and gets daily record to be sent in the form of a file, second method represents and gets daily record to be sent with text box form, when judging that log acquisition mode is first method, perform step S406, otherwise perform step S408.
Step S406, reads the content of the file representing system log message or simple network management log information,
Step S408, reads the content of the text box representing system log message or simple network management log information.
Particularly, the obtain manner of daily record has two kinds, is respectively to obtain daily record to be sent with document form and obtain daily record to be sent with text box form.When determining that log acquisition mode is for obtain with document form, read the content of the file representing system journal syslog information or simple network management daily record SNMP information, maybe when determining that log acquisition mode obtains with text box form, read the content of the file representing system journal syslog information or simple network management daily record SNMP information.The log information got is cached in target storage space, and target storage space can be specific memory space in the transmission instrument of transmission log information.Because the transmission instrument of this transmission log information have employed Python, Python is a kind of interpreted language, in text-processing, efficiency is high, text message can be read fast, and be cached in target storage space, the advantage of such process in avoiding the reading repeatedly of file, directly read from buffer memory when sending, which enhance the treatment effeciency of file, log information is obtained with text box form, this kind of mode is that the convenient test for particular log type designs, whether reception and the result of the daily record of convenient test specific type be correct.
Fig. 5 is the flow chart of Log Sender in the Log Sender method according to the embodiment of the present invention, and as shown in Figure 5, the method comprises the steps that S502 is to step S510:
Step S502, judge whether the IP of Offered target server and the target port of destination server, wherein, the quantity of the IP of destination server is multiple, when judging the target port of the IP of Offered target server and destination server, perform step S504, otherwise perform step S506.
Step S504, sets up the communication connection of target device and destination server according to the IP arranged and target port, wherein, target device is the equipment sending log information.
Step S506, receive IP and target port are arranged instruction is set, and set up the communication connection of target device and destination server according to the IP arranged set by instruction and target port.
Step S508, according to the quantity of the IP arranged or create multiple target line according to the quantity according to the IP arranged set by instruction.
Step S510, utilizes the multiple target line created to send log information to destination server.
Particularly, the programming realization of computer programming language is utilized to judge whether to be provided with IP and the target port of destination server before sending log information, if be provided with destination server IP and target port, target device is set up and is connected with the socket of destination server, if be not provided with destination server IP and target port, target device operation interface prompting user, server ip and target port are set, the communication connection after being provided with server ip and target port between realize target equipment and destination server.When judging the Log Types of log information to be sent, Log Types has system journal syslog and simple network management daily record SNMP two kinds, when the type of the log information obtained is system journal syslog, corresponding target port is set and is numbered 514 ports, when the type of the log information obtained is simple network management daily record SNMP, corresponding target port is set and is numbered 161 ports, and the quantity of destination server IP address is multiple, multiple target line is created according to multiple IP quantity, wherein, the number of IP address is quantitatively equal with the number of target line.
Send log information according to the multiple target line created to be equivalent to adopt the mode of multithreading to send log information to the mode of destination server, if adopt single-threaded mode to realize the transmission of log information, efficiency can be lower, be difficult to meet to the multiple servers efficient demand sent simultaneously, therefore adopt multithreading to send log information, send the efficiency that log information can well improve Log Sender concomitantly.
Fig. 6 is the schematic diagram of a kind of optional Log Sender device according to the embodiment of the present invention, as shown in Figure 6, Log Sender device according to the embodiment of the present invention comprises: the first acquiring unit 1, second acquisition unit 2, reading unit 3 and transmitting element 4, particularly:
First acquiring unit 1 is for obtaining the Log Types of daily record to be sent.
Second acquisition unit 2 gets for basis the log information that Log Types obtains daily record to be sent, and log information is cached in target storage space.
Reading unit 3 is cached in the log information of target storage space for reading.
Transmitting element 4 is for being sent to destination server by the log information read according to target line, and wherein, the quantity of target line is multiple.
Particularly, utilize the first acquiring unit 1 to obtain the Log Types of daily record to be sent, the Log Types that second acquisition unit 2 gets according to the first acquiring unit 1 obtains log information, the log information that second acquisition unit 2 gets is stored in target storage space simultaneously.Reading unit 3 reads log information to be sent from target storage space, reading unit 3 is read log information to be sent and is sent to destination server according to target line by transmitting element 4 from target storage space, the quantity of target line is multiple, send log information relative in prior art according to single-threaded mode, multiple target circuit sends the efficiency that can improve Log Sender.
The Log Sender device that the embodiment of the present invention provides, by obtaining the Log Types of daily record to be sent, according to the Log Types determined, obtain the log information of respective type, and the respective type log information got is stored in target storage space, when needs send log information, log information to be sent is read to target storage space, log information to be sent is sent to destination server according to multiple target line, reach the object that quantitatively can reach performance test very soon and need, thus achieve the technique effect improving tester's operating efficiency, and then solve in prior art and send the slower technical problem of journal file speed.
Fig. 7 is the schematic diagram of operation interface in the Log Sender device according to the embodiment of the present invention.
As shown in Figure 7, Fig. 7 is the operation interface of the transmission instrument of log information based on Python, the transmission instrument of log information supports Windows and linux system, windows represents with the form of exe file, after double-click is opened, after the parameter that configuration is relevant, the transmission button on clicking operation interface, can realize the transmission of log information, relevant parameter comprises Log Types, log acquisition mode, target send mode and destination server IP and target port.On linux, because Linux is with Python interpreter, after Python files passe to linux system, directly performed on linux by Python order, the relevant parameter that configuration needs just can send, and just can carry out have sent of daily record to configured server.When pressure test needs to send a large amount of daily record, under specific test environment, if resource-constrained, when higher to performance requirement, send daily record by Linux and can be good at solving the problem run in test.
Operation interface shown in Fig. 7 is the operation interface under Windows system.Operation interface shown in Fig. 7 comprises the selection of Log Types, as shown in Figure 7 " agreement ", and selectable protocol type mainly comprises two kinds: syslog protocol syslog and simple network management log protocol SNMP." mode " place in the figure 7 can arrange the target send mode of daily record as required, target send mode comprises the mode sent by sum and the mode sent by speed, select target send mode is carried out with " speed of pressing sends " button by clicking " pressing sum to send " button, after select target send mode, corresponding input can send sum or transmission speed.Log acquisition mode comprises with document form acquisition or obtains with text box form, log acquisition mode can be selected by " document source " place in the figure 7, can select to obtain with document form or obtain from text box, then can click " interpolation file path " button and select log information to be sent, when the target send mode selected is for sending by sum, click and send button, after the transmission sum reaching setting, the transmission instrument of log information stops sending, when the target send mode selected is for sending by speed, click and send button, the transmission instrument of log information can send daily record with the speed arranged always, until click stop button, the transmission instrument of log information stops sending.Destination server IP and target port can also be added as required, namely the target ip address in operation interface and target port, click " interpolation ", " editor " and " deletion " button just can add destination server IP and target port, can revise and delete destination server IP and target port simultaneously.
The transmission instrument of log information, when sending log information, once will add up quantity forwarded by Dynamic Announce every Preset Time, i.e. the accumulative daily record quantity sent of statistics; This quantity forwarded, namely adds up the daily record quantity that this sends; Actual quantity forwarded, namely show the daily record quantity and accumulative transmitting time that send an actual second, i.e. the statistics accumulative time sent, Preset Time is set to 1 second here.
Fig. 8 is the schematic diagram according to operation interface in the optional Log Sender device of the another kind of the embodiment of the present invention.As shown in Figure 8, the operation interface shown in Fig. 8 represents when needing to add destination server IP, clicks the dialog box that " interpolation " button will eject Offered target server ip and target port, at this moment can add destination server IP address according to demand.When needing amendment and deleting destination server IP, " editor " and " deletion " button can be clicked, can dialog box be ejected equally, the amendment of realize target server ip and target port and deletion.
Fig. 9 is the schematic diagram according to the optional Log Sender device of the another kind of the embodiment of the present invention, as shown in Figure 9, second acquisition unit 2 comprises: the first judge module 21 and read module 22, particularly, first judge module 21 is for judging that Log Types is the first kind or Second Type, wherein, the first kind represents that daily record to be sent is system journal, and Second Type represents that daily record to be sent is simple network management daily record; Read module 22 is for when judging that Log Types is the first kind, and reading system log information, or when judging that Log Types is Second Type, reads simple network management log information.Log Sender device according to the embodiment of the present invention also comprises determining unit 5, and determining unit 5 is for determining target send mode, and wherein, target send mode is the send mode sending log information.
Particularly, the first acquiring unit 1 is utilized to obtain the type of daily record to be sent, the first judge module 21 in second acquisition unit 2 judges that the Log Types that the first acquiring unit 1 gets is system journal syslog or simple network management daily record SNMP, when the Log Types that the first judge module 21 is judged to get is system log message, read module 22 reading system daily record syslog information, when the first judge module 21 judges that the Log Types got is simple network management daily record SNMP, read module 22 reads the information of simple network management daily record SNMP.Target send mode sends log information to utilize determining unit 5 to determine, target send mode comprises according to pre-set velocity send mode with according to default total send mode.After determining target send mode, reading unit 3 is utilized to read log information in target storage space, the target send mode that the log information that reading unit 3 reads by transmitting element 4 is determined according to determining unit 5 is sent to destination server, and the quantity of destination server is multiple here.
Figure 10 is the schematic diagram of read module in a kind of optional Log Sender device according to the embodiment of the present invention, as shown in Figure 10, read module 22 comprises: obtain submodule 221, judge submodule 222 and reading submodule 223, particularly, submodule 221 is obtained for obtaining the log acquisition mode of daily record to be sent; Judge that submodule 222 judges that log acquisition mode is first method or second method, wherein, first method represents and gets daily record to be sent in the form of a file, and second method represents and gets daily record to be sent with text box form; Reading submodule 223 is for when judging that log acquisition mode is first method, read the content of the file representing system log message or simple network management log information, or when judging that log acquisition mode is second method, read the content of the text box representing system log message or simple network management log information.
Particularly, after the first acquiring unit 1 gets Log Types, need to obtain corresponding log information, obtain the obtain manner that submodule 221 obtains log information, obtain manner comprises acquisition in the first way and obtains in a second manner, first method represents and gets daily record to be sent in the form of a file, and second method represents and gets daily record to be sent with text box form.Judge that submodule 222 is judged to obtain in the first way or obtain in a second manner, when judging that submodule 222 is judged to obtain in the first way, reading submodule 223 reads the content of the file representing system log message or simple network management log information, when judging that submodule 222 is judged to obtain in a second manner, reading submodule 223 reads the content of the text box representing system log message or simple network management log information.
Figure 11 is the schematic diagram of transmitting element in a kind of optional Log Sender device according to the embodiment of the present invention, as shown in figure 11, transmitting element 4 comprises: the second judge module 41, first sets up module 42, receiver module 43, second sets up module 44, creation module 45 and sending module 46, particularly, second judge module 41 is for judging whether the IP of Offered target server and the target port of destination server, wherein, the quantity of the IP of destination server is multiple; First sets up module 42 for when judging to arrange IP and target port, sets up the communication connection of target device and destination server according to the IP arranged and target port, and wherein, target device is the equipment sending log information; Receiver module 43 for when judging not arrange IP and target port, receive IP and target port are arranged instruction is set; Second sets up module 44 for setting up the communication connection of target device and destination server according to the IP arranged set by instruction and target port; Creation module 45 is for according to the number of IP arranged or create multiple target line according to the number according to the IP arranged set by instruction; Sending module 46 sends log information to destination server for utilizing multiple target line of establishment.
Particularly, the second judge module 41 is utilized to judge whether Offered target server ip and target port, when judging to be provided with destination server IP and target port, utilize first to set up module 42 to set up target device and be connected with the socket of destination server, target device is the transmission instrument of the log information in Fig. 2 in PC 10, and destination server is system under test (SUT) server 20 in Fig. 2.When judging not to be provided with destination server IP and target port, receiver module 43 receive IP and target port are arranged instruction is set, correspondingly, in operation interface ejection Offered target server ip as shown in Figure 8 and the dialog box of target port of target device, after destination server IP and target port are provided with, second sets up module 44 sets up target device and is connected with the socket of destination server, creation module 45 is according to the quantity of the IP address arranged, create multiple target circuit, the quantity of IP address is equal with the quantity of target line, sending module 46 can send log information to destination server faster according to the multiple target circuit created, save the processing time.
The Log Sender device of the embodiment of the present invention also comprises display unit 6, this display unit 6 is for once sending the statistical information of log information at interval of Preset Time display, wherein, statistical information comprise following one of at least: accumulative quantity forwarded is (namely, the accumulative daily record quantity sent), this quantity forwarded (namely, this send daily record quantity), actual quantity forwarded (namely, the daily record quantity that an actual second sends) and accumulative transmitting time is (namely, the accumulative time sent), in embodiments of the present invention, Preset Time can be 1 second.
The invention described above embodiment sequence number, just to describing, does not represent the quality of embodiment.
In the above embodiment of the present invention, the description of each embodiment is all emphasized particularly on different fields, in certain embodiment, there is no the part described in detail, can see the associated description of other embodiments.
In several embodiments that the application provides, should be understood that, disclosed technology contents, the mode by other realizes.Wherein, device embodiment described above is only schematic, the such as division of described unit, can be that a kind of logic function divides, actual can have other dividing mode when realizing, such as multiple unit or assembly can in conjunction with or another system can be integrated into, or some features can be ignored, or do not perform.Another point, shown or discussed coupling each other or direct-coupling or communication connection can be by some interfaces, and the indirect coupling of unit or module or communication connection can be electrical or other form.
The described unit illustrated as separating component or can may not be and physically separates, and the parts as unit display can be or may not be physical location, namely can be positioned at a place, or also can be distributed on multiple unit.Some or all of unit wherein can be selected according to the actual needs to realize the object of the present embodiment scheme.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, also can be that the independent physics of unit exists, also can two or more unit in a unit integrated.Above-mentioned integrated unit both can adopt the form of hardware to realize, and the form of SFU software functional unit also can be adopted to realize.
If described integrated unit using the form of SFU software functional unit realize and as independently production marketing or use time, can be stored in a computer read/write memory medium.Based on such understanding, the part that technical scheme of the present invention contributes to prior art in essence in other words or all or part of of this technical scheme can embody with the form of software product, this computer software product is stored in a storage medium, comprises all or part of step of some instructions in order to make a computer equipment (can be personal computer, server or the network equipment etc.) perform method described in each embodiment of the present invention.And aforesaid storage medium comprises: USB flash disk, read-only memory (ROM, Read-OnlyMemory), random access memory (RAM, Random Access Memory), portable hard drive, magnetic disc or CD etc. various can be program code stored medium.
The above is only the preferred embodiment of the present invention; it should be pointed out that for those skilled in the art, under the premise without departing from the principles of the invention; can also make some improvements and modifications, these improvements and modifications also should be considered as protection scope of the present invention.

Claims (14)

1. a Log Sender method, is characterized in that, comprising:
Obtain the Log Types of daily record to be sent;
According to the log information getting the described daily record to be sent of described Log Types acquisition, and described log information is cached in target storage space;
Read the log information being cached in described target storage space; And
The described log information read is sent to destination server according to target line, and wherein, the quantity of described target line is multiple.
2. method according to claim 1, is characterized in that, the log information according to getting the described daily record to be sent of described Log Types acquisition comprises:
Judge that described Log Types is the first kind or Second Type, wherein, the described first kind represents that described daily record to be sent is system journal, and described Second Type represents that described daily record to be sent is simple network management daily record; And
When judging that described Log Types is the described first kind, reading system log information, or when judging that described Log Types is described Second Type, read simple network management log information.
3. method according to claim 2, it is characterized in that, when judging that described Log Types is the described first kind, reading system log information, or when judging that described Log Types is described Second Type, reading simple network management log information and comprising:
Obtain the log acquisition mode of described daily record to be sent;
Judge that described log acquisition mode is first method or second method, wherein, described first method represents and gets described daily record to be sent in the form of a file, and described second method represents and gets described daily record to be sent with text box form; And
When judging that described log acquisition mode is described first method, read the content of the file representing described system log message or described simple network management log information, or when judging that described log acquisition mode is described second method, read the content of the text box representing described system log message or described simple network management log information.
4. method according to claim 1, it is characterized in that, the log information that described Log Types obtains described daily record to be sent is got in basis, and after described log information is cached in target storage space, and before reading is cached in the log information of described target storage space, described method also comprises:
Determine target send mode, wherein, described target send mode is the send mode sending described log information; And
Wherein, the described log information read is sent to destination server according to target line to comprise: according to described target send mode, the described log information read is sent to described destination server according to described target line.
5. method according to claim 4, is characterized in that, described target send mode comprises according to pre-set velocity send mode or according to default total send mode.
6. method according to claim 1, is characterized in that, the described log information read is sent to destination server according to target line and comprises:
Judge whether to arrange the IP of described destination server and the target port of described destination server, wherein, the quantity of the IP of described destination server is multiple;
When judging to arrange described IP and described target port, set up the communication connection of target device and described destination server according to the described IP arranged and described target port, wherein, described target device is the equipment sending described log information;
When judging not arrange described IP and described target port, receive described IP and described target port are arranged instruction is set, and the communication connection that described IP set by instruction and described target port set up described target device and described destination server is set according to described;
Multiple described target line is created according to the quantity of the described IP arranged or according to according to the described quantity arranging described IP set by instruction; And
The multiple described target line created is utilized to send described log information to described destination server.
7. method according to claim 1, is characterized in that, described method also comprises:
Once send the statistical information of described log information at interval of Preset Time display, wherein, described statistical information comprise following one of at least: accumulative quantity forwarded, this quantity forwarded, actual quantity forwarded and accumulative transmitting time.
8. a Log Sender device, is characterized in that, comprising:
First acquiring unit, for obtaining the Log Types of daily record to be sent;
Second acquisition unit, gets for basis the log information that described Log Types obtains described daily record to be sent, and described log information is cached in target storage space;
Reading unit, for reading the log information being cached in described target storage space; And
Transmitting element, for the described log information read is sent to destination server according to target line, wherein, the quantity of described target line is multiple.
9. device according to claim 8, is characterized in that, described second acquisition unit comprises:
First judge module, for judging that described Log Types is the first kind or Second Type, wherein, the described first kind represents that described daily record to be sent is system journal, and described Second Type represents that described daily record to be sent is simple network management daily record; And
Read module, for when judging that described Log Types is the described first kind, reading system log information, or when judging that described Log Types is described Second Type, read simple network management log information.
10. device according to claim 9, is characterized in that, described read module comprises:
Obtain submodule, for obtaining the log acquisition mode of described daily record to be sent;
Judge submodule, for judging that described log acquisition mode is first method or second method, wherein, described first method represents and gets described daily record to be sent in the form of a file, and described second method represents and gets described daily record to be sent with text box form; And
Reading submodule, for when judging that described log acquisition mode is described first method, read the content of the file representing described system log message or described simple network management log information, or when judging that described log acquisition mode is described second method, read the content of the text box representing described system log message or described simple network management log information.
11. devices according to claim 8, is characterized in that, described device also comprises:
Determining unit, for obtaining the log information of described daily record to be sent at described second acquisition unit according to getting described Log Types, and after described log information is cached in target storage space, and before described reading unit reading is cached in the log information of described target storage space, determine target send mode, wherein, described target send mode is the send mode sending described log information; And
Wherein, described transmitting element is used for, according to described target send mode, the described log information read is sent to described destination server according to described target line.
12. devices according to claim 11, is characterized in that, described target send mode comprises according to pre-set velocity send mode or according to default total send mode.
13. devices according to claim 8, is characterized in that, described transmitting element comprises:
Second judge module, arranges the IP of described destination server and the target port of described destination server for judging whether, wherein, the quantity of the IP of described destination server is multiple;
First sets up module, for when judging to arrange described IP and described target port, set up the communication connection of target device and described destination server according to the described IP arranged and described target port, wherein, described target device is the equipment sending described log information;
Receiver module, for when judging not arrange described IP and described target port, receive described IP and described target port are arranged instruction is set;
Second sets up module, for arranging according to described the communication connection that described IP set by instruction and described target port set up described target device and described destination server;
Creation module, for creating multiple described target line according to the quantity of described IP arranged or according to according to the described quantity arranging described IP set by instruction; And
Sending module, sends described log information to described destination server for utilizing the multiple described target line of establishment.
14. devices according to claim 8, is characterized in that, described device also comprises:
Display unit, for once sending the statistical information of described log information at interval of Preset Time display, wherein, described statistical information comprise following one of at least: accumulative quantity forwarded, this quantity forwarded, actual quantity forwarded and accumulative transmitting time.
CN201510456900.1A 2015-07-29 2015-07-29 Log sending method and device Pending CN104967696A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510456900.1A CN104967696A (en) 2015-07-29 2015-07-29 Log sending method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510456900.1A CN104967696A (en) 2015-07-29 2015-07-29 Log sending method and device

Publications (1)

Publication Number Publication Date
CN104967696A true CN104967696A (en) 2015-10-07

Family

ID=54221633

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510456900.1A Pending CN104967696A (en) 2015-07-29 2015-07-29 Log sending method and device

Country Status (1)

Country Link
CN (1) CN104967696A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107273266A (en) * 2017-06-09 2017-10-20 上海艾融软件股份有限公司 A kind of processing method and processing device of application daily record
CN107609114A (en) * 2017-09-13 2018-01-19 广东欧珀移动通信有限公司 Log information report method, device and storage medium, ADSP and terminal
CN107783880A (en) * 2017-09-01 2018-03-09 郑州云海信息技术有限公司 A kind of log analysis method of server system, device and server system

Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101110822A (en) * 2007-07-06 2008-01-23 华为技术有限公司 Event notice sending method, system and equipment based on network configuration protocol
US20080168242A1 (en) * 2007-01-05 2008-07-10 International Business Machines Sliding Window Mechanism for Data Capture and Failure Analysis
CN101651707A (en) * 2009-09-22 2010-02-17 西安交通大学 Method for automatically acquiring user behavior log of network
CN101753984A (en) * 2008-11-27 2010-06-23 北京中星微电子有限公司 Processing method of video monitoring system journals, system and server
CN101764712A (en) * 2010-01-21 2010-06-30 瑞斯康达科技发展股份有限公司 System and method for transmitting log information
CN101826993A (en) * 2010-02-04 2010-09-08 蓝盾信息安全技术股份有限公司 Method, system and device for monitoring security event
US20110314148A1 (en) * 2005-11-12 2011-12-22 LogRhythm Inc. Log collection, structuring and processing
CN102780777A (en) * 2012-07-19 2012-11-14 北京蓝汛通信技术有限责任公司 Log collecting method and log collecting system
CN102790686A (en) * 2011-05-17 2012-11-21 浙江核新同花顺网络信息股份有限公司 Log data collecting method and system and log collecting server
CN103200037A (en) * 2013-04-11 2013-07-10 深圳市共进电子股份有限公司 System log (syslog) storing method
CN103309767A (en) * 2012-03-08 2013-09-18 阿里巴巴集团控股有限公司 Method and device for processing client log
CN103326896A (en) * 2013-06-07 2013-09-25 合一信息技术(北京)有限公司 System and method for collecting information data generated by a user on Internet
CN103927338A (en) * 2014-03-26 2014-07-16 网神信息技术(北京)股份有限公司 Log information storage processing method and log information storage processing device
CN104021088A (en) * 2014-06-24 2014-09-03 广东睿江科技有限公司 Log storage method and device
CN104113431A (en) * 2014-02-20 2014-10-22 西安未来国际信息股份有限公司 Distributed log acquisition pipeline design acting on cloud computing data center
CN104461845A (en) * 2014-11-17 2015-03-25 中国航天科工集团第二研究院七〇六所 Self-adaption method of thread pool of log collection system

Patent Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110314148A1 (en) * 2005-11-12 2011-12-22 LogRhythm Inc. Log collection, structuring and processing
US20080168242A1 (en) * 2007-01-05 2008-07-10 International Business Machines Sliding Window Mechanism for Data Capture and Failure Analysis
CN101110822A (en) * 2007-07-06 2008-01-23 华为技术有限公司 Event notice sending method, system and equipment based on network configuration protocol
CN101753984A (en) * 2008-11-27 2010-06-23 北京中星微电子有限公司 Processing method of video monitoring system journals, system and server
CN101651707A (en) * 2009-09-22 2010-02-17 西安交通大学 Method for automatically acquiring user behavior log of network
CN101764712A (en) * 2010-01-21 2010-06-30 瑞斯康达科技发展股份有限公司 System and method for transmitting log information
CN101826993A (en) * 2010-02-04 2010-09-08 蓝盾信息安全技术股份有限公司 Method, system and device for monitoring security event
CN102790686A (en) * 2011-05-17 2012-11-21 浙江核新同花顺网络信息股份有限公司 Log data collecting method and system and log collecting server
CN103309767A (en) * 2012-03-08 2013-09-18 阿里巴巴集团控股有限公司 Method and device for processing client log
CN102780777A (en) * 2012-07-19 2012-11-14 北京蓝汛通信技术有限责任公司 Log collecting method and log collecting system
CN103200037A (en) * 2013-04-11 2013-07-10 深圳市共进电子股份有限公司 System log (syslog) storing method
CN103326896A (en) * 2013-06-07 2013-09-25 合一信息技术(北京)有限公司 System and method for collecting information data generated by a user on Internet
CN104113431A (en) * 2014-02-20 2014-10-22 西安未来国际信息股份有限公司 Distributed log acquisition pipeline design acting on cloud computing data center
CN103927338A (en) * 2014-03-26 2014-07-16 网神信息技术(北京)股份有限公司 Log information storage processing method and log information storage processing device
CN104021088A (en) * 2014-06-24 2014-09-03 广东睿江科技有限公司 Log storage method and device
CN104461845A (en) * 2014-11-17 2015-03-25 中国航天科工集团第二研究院七〇六所 Self-adaption method of thread pool of log collection system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107273266A (en) * 2017-06-09 2017-10-20 上海艾融软件股份有限公司 A kind of processing method and processing device of application daily record
CN107273266B (en) * 2017-06-09 2020-09-29 上海艾融软件股份有限公司 Application log processing method and device
CN107783880A (en) * 2017-09-01 2018-03-09 郑州云海信息技术有限公司 A kind of log analysis method of server system, device and server system
CN107609114A (en) * 2017-09-13 2018-01-19 广东欧珀移动通信有限公司 Log information report method, device and storage medium, ADSP and terminal
CN107609114B (en) * 2017-09-13 2021-05-28 Oppo广东移动通信有限公司 Log information reporting method and device, storage medium, ADSP and terminal

Similar Documents

Publication Publication Date Title
US11562380B2 (en) System and method for applying tracing tools for network locations
CN107818163A (en) Page display method, device, computer equipment and storage medium
CN104994401A (en) Barrage processing method, device and system
CN104915296A (en) Buried point testing method, data query method and device
CN107872534B (en) Information pushing method and device, server and readable storage medium
CN105337843A (en) Interaction system and method, client, and background server
CN102265297A (en) Techniques to manage and display related communications
CN106469044A (en) The method and apparatus realizing page jump
CN104092596B (en) A kind of management method, Apparatus and system of music groups of users
CN103327021B (en) Method, devices and system of multi-device interaction
CN104468592A (en) Login method and system
CN107665237B (en) Data structure classification device, and unstructured data publishing and subscribing system and method
CN113014681A (en) Network card binding method and device of multi-network card server, electronic equipment and storage medium
CN105611422A (en) Online live broadcast method based on multi-media list and apparatus thereof
CN104216740A (en) Application software management method and device and terminal
CN104852937A (en) Network access method and device for mobile application
CN104967696A (en) Log sending method and device
CN105447151A (en) Method for accessing distributed database, data source proxy apparatus and application server
CN105808642A (en) Recommendation method and device
CN105100291A (en) Resource address generating method, device and system
CN103986620A (en) Monitoring item management method and system based on XML mode
CN107153468A (en) Emoticon exchange method and device based on internet
CN105630953A (en) Method and device for displaying news by mobile search client
CN104239451A (en) Method and device for representing search results
CN104333791A (en) Interaction method, device and system for mobile terminal and smart television

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20151007

RJ01 Rejection of invention patent application after publication