CN107784050A - Log information lookup method and device - Google Patents

Log information lookup method and device Download PDF

Info

Publication number
CN107784050A
CN107784050A CN201611154471.3A CN201611154471A CN107784050A CN 107784050 A CN107784050 A CN 107784050A CN 201611154471 A CN201611154471 A CN 201611154471A CN 107784050 A CN107784050 A CN 107784050A
Authority
CN
China
Prior art keywords
found
journal file
server
default
date
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
CN201611154471.3A
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201611154471.3A priority Critical patent/CN107784050A/en
Publication of CN107784050A publication Critical patent/CN107784050A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/14Details of searching files based on file metadata
    • G06F16/144Query formulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1805Append-only file systems, e.g. using logs or journals to store data
    • G06F16/1815Journaling file systems
    • 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
    • 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]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mathematical Physics (AREA)
  • Library & Information Science (AREA)
  • Debugging And Monitoring (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present invention relates to a kind of log information lookup method and device.Methods described includes:Keyword to be found, log-file information to be found and the server info to be found of user's input are obtained, the log-file information to be found includes journal file name to be found and journal file path to be found;The journal file to be found according to corresponding to obtaining the journal file name to be found on server corresponding to the server info to be found and journal file path to be found from the server info to be found, and the journal file to be found is preserved into default local address;The log information that the keyword to be found is included in the journal file to be found is searched in the default local address according to the keyword to be found.By this method directly by directly being searched after the acquisition of information that user inputs to journal file to be found locally, the occupancy of server resource is considerably reduced, alleviates the burden of server.

Description

Log information lookup method and device
Technical field
The present invention relates to field of computer technology, more particularly to a kind of log information lookup method and device.
Background technology
With the continuous development of computer technology, the data volume of computer disposal becomes more and more huger, and server face The task amount for the data processing faced also becomes increasingly to weigh.Journal file have recorded the Action Events in server running, It can be realized by the inquiry to journal file and historical data is handled, the function such as investigation server failure.
Traditional log query need to first log into log server, be checked one by one by order key word of the inquiry, if stepped on It is excessive to record the user of server, then server resource can be caused nervous, increase the burden of server.
The content of the invention
Based on this, it is necessary to bear problems of too for server, there is provided a kind of log information lookup method and device, with Reduce server burden.
A kind of log information lookup method, including:
Keyword to be found, log-file information to be found and the server info to be found of user's input are obtained, it is described Log-file information to be found includes journal file name to be found and journal file path to be found;
According to the server info to be found and journal file path to be found from the server info pair to be found Journal file to be found corresponding to the journal file name to be found is obtained on the server answered, and the daily record to be found is literary Part is preserved into default local address;
Searched in the journal file to be found and wrapped in the default local address according to the keyword to be found Log information containing the keyword to be found.
In one of the embodiments, it is described according to the server info to be found and journal file path to be found from Daily record text to be found corresponding to the journal file name to be found is obtained corresponding to the server info to be found on server Part, and the journal file to be found is preserved to default local address included:
Judge whether include date and time information in the journal file name to be found, if so, then by the filename to be found The filename to be found for including the default date is substituted for, according to the server info to be found and journal file path to be found Preset from described include is obtained corresponding to the server info to be found on server corresponding to the filename to be found on date Journal file to be found, and journal file to be found corresponding to the filename to be found comprising the default date is preserved to pre- If local address in;
If it is not, then according to the server info to be found and journal file path to be found from the server to be found Journal file corresponding with the journal file name to be found is obtained corresponding to information on server to be found, according to described to be checked Journal file is looked for corresponding to journal file name to obtain journal file to be found corresponding to the default date, and by the default date pair The journal file to be found answered is preserved into default local address.
In one of the embodiments, it is described that daily record to be found corresponding with presetting the date is obtained according to the journal file File includes:
Traveled through from the journal file tail row to the journal file first trip, the default date is included when detecting Field when, start to obtain the information of the journal file;
When detecting that including default the previous day on date corresponds to the field on date, terminate to obtain the letter of the journal file Breath;
According to journal file to be found corresponding with the default date described in the generation of the information of the journal file got.
In one of the embodiments, it is described to be searched according to the keyword to be found in the default local address The log information comprising the keyword to be found includes in the journal file to be found:
The journal file to be found is searched in the default local address according to the keyword to be found, obtained Log information using the keyword to be found as the default line number of starting point.
In one of the embodiments, it is described according to the server info to be found and journal file path to be found from Daily record text to be found corresponding to the journal file name to be found is obtained corresponding to the server info to be found on server Part includes:
Type of server to be found is obtained according to the server info to be found;
According to the server info to be found and journal file path to be found from the type of server pair to be found Journal file to be found corresponding to the journal file name to be found is obtained on the server answered.
A kind of log information searches device, including:
Data obtaining module, for obtaining keyword to be found, the log-file information to be found and to be checked of user's input Server info is looked for, the log-file information to be found includes journal file name to be found and journal file path to be found;
Journal file acquisition module, for according to the server info to be found and journal file path to be found from institute State and obtain journal file to be found corresponding to the journal file name to be found corresponding to server info to be found on server, And the journal file to be found is preserved into default local address;
Log information searching modul, for searching institute in the default local address according to the keyword to be found State the log information that the keyword to be found is included in journal file to be found.
In one of the embodiments, the journal file acquisition module is additionally operable to judge the journal file name to be found In whether include date and time information, if so, the filename to be found to be then substituted for the filename to be found for including the default date, The service according to corresponding to the server info to be found and journal file path to be found from the server info to be found Journal file to be found corresponding to the filename to be found comprising the default date is obtained on device, and described will include default day Journal file to be found corresponding to the filename to be found of phase is preserved into default local address;
If it is not, then according to the server info to be found and journal file path to be found from the server to be found Journal file corresponding with the journal file name to be found is obtained corresponding to information on server to be found, according to described to be checked Journal file is looked for corresponding to journal file name to obtain journal file to be found corresponding to the default date, and by the default date pair The journal file to be found answered is preserved into default local address.
In one of the embodiments, the journal file acquisition module is additionally operable to from the journal file tail row to described Journal file first trip is traveled through, and when detecting the field comprising the default date, starts to obtain the journal file Information;
When detecting that including default the previous day on date corresponds to the field on date, terminate to obtain the letter of the journal file Breath;And
According to journal file to be found corresponding with the default date described in the generation of the information of the journal file got.
In one of the embodiments, the log information searching modul is additionally operable to according to the keyword to be found in institute State and the journal file to be found is searched in default local address, obtain the default row using the keyword to be found as starting point Several log informations.
In one of the embodiments, the journal file acquisition module is additionally operable to according to the server info to be found Obtain type of server to be found;And
According to the server info to be found and journal file path to be found from the type of server pair to be found Journal file to be found corresponding to the journal file name to be found is obtained on the server answered.
Above-mentioned log information lookup method and device, keyword to be found is inputted by user, journal file to be found is believed The information such as breath and server info to be found, directly according to corresponding to log-file information to be found removes server info to be found Journal file is obtained on server, the journal file got is stored in local address, further according to the pass to be found of input Key word searches information in the journal file in local address.Do not need first login service device to be searched, considerably reduce The occupancy of server resource, alleviate the burden of server.Meanwhile daily record text is directly obtained according to log-file information to be found Part is locally carrying out the lookup of log information, improves the lookup speed of information.
Brief description of the drawings
Fig. 1 is the application environment schematic diagram of log information lookup method in one embodiment;
Fig. 2 is the flow chart of log information lookup method in one embodiment;
Fig. 3 is user terminal surface chart in one embodiment;
Fig. 4 is the flow chart of log information lookup method in another embodiment;
Fig. 5 is the filename date to be found replacement flow chart comprising the date in one embodiment;
Fig. 6 is keyword extraction flow chart in one embodiment;
Fig. 7 is the structural representation that log information searches device in one embodiment.
Embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, it is right below in conjunction with drawings and Examples The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and It is not used in the restriction present invention.
Fig. 1 is the application environment schematic diagram of log information lookup method in one embodiment.As shown in figure 1, this applies ring Border includes user terminal 102 and server 104, and user terminal 102 obtains the keyword to be found of user's input, daily record to be found The relevant information of the journal file to be found such as fileinfo and server info to be found, and according to these relevant informations from service Journal file to be found is obtained in device 104, is stored in the local address of user terminal 102, is searched and obtain in local address Take correlation log information.User terminal 102 is the equipment that can access network and support application program, such as can be PC terminals, move Dynamic terminal etc..Server 104 can be a computer or multiple stage computers etc..
Fig. 2 is the flow chart of log information lookup method in one embodiment.As shown in Fig. 2 the log information lookup side Method includes step S202 to step S206.Wherein:
Step S202, obtain keyword to be found, log-file information to be found and the server to be found of user's input Information, the log-file information to be found include journal file name to be found and journal file path to be found.
In the present embodiment, journal file is the file deposited on server, be have recorded in server running Action Events, it can be realized by the inquiry to journal file and historical data is handled, the function such as investigation server failure. Keyword to be found refers to the key-strings that user searches from the needs that terminal inputs from journal file to be found, Ke Yishi Chinese character, English character or symbol, such as:exception.Log-file information to be found includes journal file to be found The storing path of filename and journal file to be found.Wherein, storing path refers to the storing place of journal file on the server Location path, such as:\\192.168.25.4\search\readroot.
In the present embodiment, server info to be found refers to the information for depositing the server of journal file to be found, bag Include server system title, type of server, server ip (Internet Protocol, procotol) address, server end One or more in mouth, login username, login password etc., user are obtained on the server by server info to be found Journal file.Wherein, the server system title, type of server, service inputted is needed for different server environments The information such as device IP address, Service-Port, login username, login password are also different.
In the present embodiment, server system title refers to the systematic name of login on the server, such as fams_ core_stg1.Type of server can be divided into can Telnet server and can not Telnet server.Wherein, far Cheng Denglu refers to by an order authorized user can be allowed to enter server, while the user allowed access into operates server The anything of permission.Server ip address refers to that server distributes a logical address in internet, such as: 192.168.25.4.Service-Port refers to the outlet of server and extraneous Communication, such as:80 ports of server, 21 ports etc..Login username refers to the account name of login service device, and login password refers to that the account name of login service device is corresponding Account password, such as:Login user entitled Root, login password action123.
Step S204, believed according to server info to be found and journal file path to be found from the server to be found Obtain journal file to be found corresponding to the journal file name to be found corresponding to breath on server, and by the daily record to be found File is preserved into default local address.
In the present embodiment, the server info to be found inputted according to user finds corresponding server, by be checked Look for journal file path to obtain journal file to be found, the journal file got is saved in default local address.Its In, default local address is the default file storing path of user terminal, such as:E:\server\search\root.Directly Journal file to be found is obtained by server info to be found, it is not necessary to which user removes login service device, avoids multi-user simultaneously Login service device, it can greatly reduce server burden.
In the present embodiment, daily record text to be found is obtained by journal file name to be found and journal file path to be found Part compressed package, the journal file compressed package to be found got is deposited in into default compressed package storing directory, and to compressed package Decompressed, the journal file to be found after decompression is saved in the file storing directory specified, and delete compressed package simultaneously The compressed package deposited in compressed package storing directory.
Step S206, searched in journal file to be found and wrapped in the default local address according to keyword to be found Log information containing the keyword to be found.
In the present embodiment, the journal file got is searched line by line, extraction includes the keyword of user's input Row information, wherein row information refers to each row information in journal file.The present count comprising the keyword can also be chosen The row information of amount, such as:It is 3 to input predetermined number, then the row information comprising keyword in journal file is found be present When, then extract the 3 row log informations using the row information comprising the keyword as starting point.
Fig. 3 is user terminal surface chart in one embodiment.As shown in figure 3, setting area 301 is the parameter of user's input, Including the server infos such as daily record environment, systematic name, server ip address, Service-Port, in addition to server source file Path, the preset address information such as file preservation address, local keyword file preservation address are locally-downloaded.Wherein, the day of input Date in will filename can be any date, and after submission, system can be automatically converted into the default date.User is according to setting After area 301 inputs information, click on submission and then begin look for keyword, and the result that keyword is searched is shown in viewing area Show, the lookup result that viewing area 302 is shown in Fig. 3 is the keyword lookup result that default line number is 5 rows.It is aobvious that stopping can be clicked on Show that button stops search key, click on and empty viewing area button and empty content in viewing area 302.
Above-mentioned log information lookup method, keyword to be found, log-file information to be found are inputted by user and treated Search the information such as server info, the server directly according to corresponding to log-file information to be found removes server info to be found Upper acquisition journal file.The journal file got is stored in local address, existed further according to the keyword to be found of input Information is searched in journal file in local address.User does not need first login service device to be searched, and gets day to be found Directly searched after will file locally, considerably reduce the occupancy of server resource, alleviate the burden of server.Together When, user directly obtains journal file according to log-file information to be found and is locally carrying out the lookup of log information, improves The lookup speed of information.
Fig. 4 is the flow chart of log information lookup method in another embodiment.As shown in figure 4, the log information is searched Method includes step S402 to step S412.Wherein:
Step S402, obtain keyword to be found, log-file information to be found and the server to be found of user's input Information, the log-file information to be found include journal file name to be found and journal file path to be found.
In the present embodiment, journal file is the file deposited on server, be have recorded in server running Action Events, it can be realized by the inquiry to journal file and historical data is handled, the function such as investigation server failure. Keyword to be found refers to the key-strings that user searches from the needs that terminal inputs from journal file to be found, such as: exception.Log-file information to be found includes the filename of journal file to be found and the storing path of file.Wherein, Storing path refers to the storage address path of file on the server, such as:\\192.168.25.4\search\readroot.
In the present embodiment, server info to be found refers to the information for depositing the server of journal file to be found, bag Server environment, server ip address, Service-Port, login username, login password etc. are included, user passes through service to be found Journal file on the device acquisition of information server.The server ip wherein, inputted for different server environment needs The information such as location, Service-Port, login username, login password are also different.
Step S404, type of server to be found is obtained according to the server info to be found.
In the present embodiment, type of server to be found be divided into can Telnet and can not Telnet server.Can The server of Telnet can directly pass through the IP address of server, Service-Port name, login username and login password Logged in.Can not Telnet server because server can set fire wall, it is necessary to be adjusted by special IP address Go to log in special purpose interface.Wherein, fire wall refers to the network safety system between a kind of internally positioned network and external network, According to specific rule, it is allowed to or the data of limitation transmission pass through.
Such as due to there is provided fire wall, the server of STG (Speed Tools Group, high-speed tool group) environment without Method direct Telnet from office network segment, then can only go to access the service by a special IP address of server Device, if the IP address is:10.36.2.15, then the server of the STG environment is directly accessed by this IP address can.
In the present embodiment, by the differentiation to type of server, different login sides is used for different servers Formula, the malicious attack to server can be prevented, improve the security of server.
Step S406, judge whether include date and time information in the journal file name to be found, if so, then jumping to step S408, if it is not, then jumping to step S410.
Step S408, filename to be found is substituted for the filename to be found for including the default date, according to clothes to be found Business device information and journal file path to be found are from acquisition is treated comprising the default date on server corresponding to the type of server Journal file to be found, is preserved into local address corresponding to locating file name.
In the present embodiment, the option inputted by user judges whether believe in the journal file name to be found comprising the date Breath, if being used to distinguish date blank character comprising the date, in the further inputting date of user.The blank character can be empty The forms such as lattice, round dot, strigula.Such as:The date is included in journal file to be found, the form on the date is " 2016-06- 01 ", then it is just strigula i.e. "-" to be used to distinguish the blank character of date in the date.
In the present embodiment, if including the date in journal file name to be found, by the day in journal file name to be found Phase is substituted for the default date, only obtains journal file corresponding to the default date on the server.Such as:User inputs to be checked Look for journal file entitled " pafa.log2016-06-01 ", will be replaced on the date by strigula Identification Date, and according to the form Into the default date, if the default date is " 2016-09-12 ", then the journal file name to be found after replacement is exactly “pafa.log2016-09-12”。
In the present embodiment, according to server info to be found and journal file path to be found from the type of server pair The server answered obtains journal file to be found corresponding to amended journal file name to be found, and the daily record to be found is literary Part is saved in local address.The journal file to be found is exactly the daily record text of the default date server processing data recorded Part.
Step S410, according to server info to be found and journal file path to be found from corresponding to the type of server Journal file corresponding with journal file name to be found is obtained on server to be found, according to corresponding to journal file name to be found Journal file obtains journal file to be found corresponding to the default date, and preserves into default local address.
In the present embodiment, if not including the date in journal file name to be found, directly believed according to server to be found Breath and journal file path to be found from corresponding to the type of server on server to be found obtain and journal file to be found Journal file corresponding to name.All log informations of the server process data are have recorded in the journal file, pass through daily record text Date described in part distinguishes the log information of not same date, dat recorder log information on the day of corresponding to log information Tail row.
In the present embodiment, after getting journal file, daily record corresponding to the default date is searched in the journal file Information.Specifically, traveled through from the journal file tail row to the journal file first trip, the default day is included when detecting During the field of phase, start to obtain the information of the journal file;When detecting field that the date is corresponded to comprising default the previous day on date When, terminate to obtain the information of the journal file;According to the generation of the information of the journal file got is described and the default date pair The journal file to be found answered.
Step S412, journal file to be found is searched in default local address according to the keyword to be found, obtained Log information using the keyword to be found as the default line number of starting point.
In the present embodiment, the keyword to be found of user's input is searched in journal file to be found, is obtained with to be checked Look for the log information for the default line number that keyword is starting point.The default line number can be user's input or fix Line number value.
Above-mentioned log information lookup method, user do not need first login service device to be searched, directly pass through the letter of input Breath is directly searched after getting journal file to be found locally, considerably reduces the occupancy of server resource, is mitigated The burden of server, while improve the lookup speed of information.
Fig. 5 is the filename date to be found replacement flow chart comprising the date in one embodiment.As shown in figure 5, the stream Journey includes step S502 to step S520, wherein:
Step S502, obtain the default date.
In the present embodiment, the date that the date is the previous day system data is preset.Date first on the day of acquisition system, and Date the previous day is calculated according to the date on the day of system.Such as:Date on the day of system is " 2016-09-12 ", then calculating Date the previous day is just " 2016-09-11 ".
Step S504, date the previous day is revised as by default form according to separator.
In the present embodiment, the blank character in system data is "-", according to "-" is revised as into default lattice the default date Formula, amended default date are " 20160911 ".In other embodiments, blank character can also be space, round dot etc..
Step S506, judge whether journal file name to be found is form 1, if so, step S508 is then performed, if it is not, then Perform step S510.
In the present embodiment, the journal file name to be found of user's input has four kinds of forms, and these four forms are respectively:Lattice Formula 1 is " pafa.YYYYMMDD.txt ", form 2 is " pafa.YYYY-MM-DD.txt ", form 3 is " pafa.logYYYYMMDD ", format 4 are " pafa.log.YYYY-MM-DD ".Journal file name to be found is carried out with form 1 Matching, if the match is successful with form 1, judges the journal file to be found for form 1, performs step S508, if with form 1 With failure, then step S510 is performed.
Step S508, journal file name to be found is split according to form 1, and with default data combination, jumped to after combination Step S520.
In the present embodiment, journal file name to be found is split according to form 1, obtains file names portion and date Part.Such as:The journal file to be found of input is entitled " pafa.20160612.txt ", then the result split by form 1 obtains To " pafa. ", " 20160612 ", " .txt " three parts." pafa. " and " .txt " is file names portion, and " 20160612 " are Day part.Go to replace with the default date and split obtained day part, reconfigure to obtain to be found corresponding to the default date Journal file name is just " pafa.20160911.txt ".
Step S510, judge whether journal file name to be found is form 2, if so, step S512 is then performed, if it is not, then Perform step S514.
In the present embodiment, if journal file name to be found is with form 1, it fails to match, further by daily record to be found text Part name is matched with form 2.If with form 2, the match is successful, performs step S512, if it fails to match with form 2, performs Step S514.
Step S512, journal file name to be found is split according to form 2, and be combined with the default date, held after combination Row step S520.
In the present embodiment, journal file name to be found is split according to form 2, obtains file names portion and date Part.Such as:The journal file to be found of input is entitled " pafa.2016-06-12.txt ", then the result split by form 2 Obtain " pafa. ", " 2016-06-12 ", " .txt " three parts.Gone to replace the day part for splitting and obtaining with the default date again, Journal file name to be found corresponding to reconfiguring to obtain the default date is just " pafa.20160911.txt ".
Step S514, judge whether journal file name to be found is form 3, if so, step S516 is then jumped to, if it is not, Then perform step S518.
In the present embodiment, if journal file name to be found mismatches with form 1 and form 2, by daily record to be found text Part name is matched with form 3, if being matched with form 3, is performed step S516, if it fails to match with form 3, is performed step S518。
Step S516, journal file name to be found is split according to form 3, and be combined with the default date, held after combination Row step S520.
In the present embodiment, journal file name to be found is split according to form 3, and be combined with the default date Obtain journal file name to be found corresponding to the default date.
Step S518, journal file name to be found is determined as format 4, and journal file to be found is split according to format 4 Name, and be combined with the default date, step S520 is performed after combination.
In the present embodiment, will be to be checked if journal file name to be found and form 1, form 2 and form 3 all mismatch Journal file name is looked for be determined as format 4.Journal file name to be found is split according to format 4, and carried out with the default date Combination obtains journal file name to be found corresponding to the default date.
Step S520, return to journal file name to be found.
In the present embodiment, default date step S508, step S512, step S516 or step S518 obtained is corresponding Journal file name to be found return.
Fig. 6 is keyword extraction flow chart in one embodiment.As shown in fig. 6, the flow includes step S602 to step S632, wherein:
Step S602, judges whether journal file name to be found includes the date, if it is not, step S604 is then performed, if so, then The journal file to be found is to preset journal file to be found corresponding to the date, performs step S618.
In the present embodiment, after getting journal file to be found, then default key is searched in journal file to be found Word.If including the date in journal file name to be found, the journal file to be found only have recorded the log information on the date, that Directly preset keyword can be searched.If not including the date in journal file name to be found, the daily record to be found The file record server all log informations, then need first to find the log information on default date in journal file, Preset keyword is searched again.
Step S604, begun look for from the tail row of the journal file to be found whether comprising the default date, if so, then performing Step S606, if it is not, then performing step S608.
In the present embodiment, if not including the date in journal file name to be found, then remember in the journal file to be found All log informations of the server process data have been recorded, have been distinguished not on the same day by the date described in journal file to be found The log information of phase, the tail row of the log information on the day of of dat recorder corresponding to log information.
In the present embodiment, searched line by line to first trip from the tail row of the journal file to be found, first determine whether tail row Whether comprising the default date, if tail row includes the default date, step S606 start recording log informations are performed, are not wrapped if tail is capable Containing the default date, then step S608 is performed, jumps to next line.
Step S606, the row log information is charged in journal file to be found corresponding to the default date, then performs step Rapid 612.
In the present embodiment, it is somebody's turn to do if finding and being currently located in capable log information comprising default date, start recording Row log information.
Step S608, search line number and subtract 1.
In the present embodiment, do not include the default date in capable log information if searching, search line number and subtract 1, and Continued to search in the log information being expert at after redirecting.
Step S610, whether the row log information is judged comprising the default date, if it is not, step S608 is then performed, if so, then Perform step S606.
In the present embodiment, judge to be currently located in capable log information whether comprising the default date, if it is not, then continuing Searched in next line, if so, then performing the row log information that step S606 start recordings include the default date.
Step S612, search line number and subtract 1.
In the present embodiment, start recording row daily record letter if being currently located in capable log information comprising the default date Breath, after record is completed, search line number and subtract 1, continue to search for next line log information.
Step S614, judges whether the row log information includes date the previous day on default date, if it is not, then performing step S606, if so, then performing step S616.
In the present embodiment, after start recording presets log information corresponding to the date, until the row daily record letter recorded Date comprising default the previous day on date in breath then stop recording.Specifically, judge the log information of current line whether comprising pre- If date the previous day on date, if it is not, then continuing to record the log information of current line, if so, the then day of stop recording current line Will information.
Step S616, journal file record to be found corresponding to the default date finish.
In the present embodiment, the log information recorded in step S604 to step S614 is daily record corresponding to the default date Information, the journal file to be found according to corresponding to the log information of record generates the default date.
Whether step S618, the first trip for presetting journal file to be found corresponding to the date from this are begun look for comprising key Word, if it is not, step S620 is then performed, if so, then performing step S624.
In the present embodiment, if including the date in journal file to be found, the journal file to be found is default day Journal file to be found corresponding to phase, the log information for including preset keyword is searched directly in the journal file to be found. It is to be checked corresponding to the default date generated in step S604 to step S616 if not including the date in journal file to be found Look for the log information that lookup includes preset keyword in journal file.
In the present embodiment, begun look for from the first trip of journal file to be found corresponding to the default date, if first trip includes Preset keyword then start recording row log information, if first trip does not include preset keyword jumping to next line continues to look into Look for.
Step S620, search line number and add 1.
In the present embodiment, after lastrow log information searches completion, search line number and add 1, continue to search for next line day Will information.
Step S622, judges whether the row includes preset keyword, if it is not, step S620 is then performed, if so, then performing step Rapid S624.
In the present embodiment, the row log information is searched, this is recorded if preset keyword is included in the row log information Row log information, and jump to next line log information and continue to search for, otherwise jump directly to next line log information and looked into Look for.
Step S624, record the row log information.
Step S626, judge whether write line number is less than the line number of user's input, if it is not, step S628 is then performed, if so, Then perform step S630.
In the present embodiment, after recording the row log information, the daily record being expert at preset keyword of record is judged Information is the line number whether starting point is less than user's needs to the line number for being currently located capable log information, if so, then record is current The log information being expert at, if it is not, then performing step S630.
Step S628, search line number and add 1, then perform step 624.
In the present embodiment, if write-in line number is less than the line number of user's input, search line number and add 1, continue log Information.
Step S630, judge whether not search log information also, if so, step S618 is then performed, if it is not, then performing step Rapid S630.
Step S632, log information are searched and finished.
In the present embodiment, looked into the journal file to be found according to corresponding to step S618 to step S632 on the default date Look for the log information for including preset keyword.Search whether to include keyword line by line since the first trip of journal file to be found, The row log information is obtained if comprising keyword, and is obtained using the row log information as daily record corresponding to the default line number of starting point Information, untill all log informations are searched and finished.For example the line number required for user's input is 5, then is wrapped when finding Row log information containing keyword, then record the 5 row log informations using the row log information as starting point.As shown in figure 3, user The shown result that as keyword obtains in viewing area 302.
Fig. 7 is the structural representation that log information searches device in one embodiment.As shown in fig. 7, the log information is looked into Device 700 is looked for include data obtaining module 702, journal file acquisition module 704 and log information searching modul 706.Wherein:
Data obtaining module 702, for obtaining the keyword to be found of user's input, log-file information to be found and treating Server info is searched, the log-file information to be found includes journal file name to be found and journal file road to be found Footpath.
Journal file acquisition module 704, for according to the server info to be found and journal file path to be found From daily record to be found corresponding to the journal file name to be found is obtained corresponding to the server info to be found on server File, and the journal file to be found is preserved into default local address.
In one of the embodiments, journal file acquisition module 704 is additionally operable to judge the journal file name to be found In whether include date and time information, if so, the filename to be found to be then substituted for the filename to be found for including the default date, The service according to corresponding to the server info to be found and journal file path to be found from the server info to be found Journal file to be found corresponding to the filename to be found comprising the default date is obtained on device, and described will include default day Journal file to be found corresponding to the filename to be found of phase is preserved into default local address;
If it is not, then according to the server info to be found and journal file path to be found from the server to be found Journal file corresponding with the journal file name to be found is obtained corresponding to information on server to be found, according to described to be checked Journal file is looked for corresponding to journal file name to obtain journal file to be found corresponding to the default date, and by the default date pair The journal file to be found answered is preserved into default local address.
In one of the embodiments, journal file acquisition module 704 is additionally operable to from the journal file tail row to described Journal file first trip is traveled through, and when detecting the field comprising the default date, starts to obtain the journal file Information;
When detecting that including default the previous day on date corresponds to the field on date, terminate to obtain the letter of the journal file Breath;
According to journal file to be found corresponding with the default date described in the generation of the information of the journal file got.
In one of the embodiments, journal file acquisition module 704 is additionally operable to according to the keyword to be found in institute State and the journal file to be found is searched in default local address, obtain the default row using the keyword to be found as starting point Several log informations.
In one of the embodiments, journal file acquisition module 704 is additionally operable to according to the server info to be found Obtain type of server to be found;
According to the server info to be found and journal file path to be found from the type of server pair to be found Journal file to be found corresponding to the journal file name to be found is obtained on the server answered.
Log information searching modul 706, for being looked into according to the keyword to be found in the default local address The log information for including the keyword to be found is looked in the journal file to be found.
One of ordinary skill in the art will appreciate that realize all or part of flow in above-described embodiment method, being can be with The hardware of correlation is instructed to complete by computer program, described program can be stored in a non-volatile computer and can be read In storage medium, the program is upon execution, it may include such as the flow of the embodiment of above-mentioned each method.Wherein, described storage is situated between Matter can be magnetic disc, CD, read-only memory (Read-Only Memory, ROM) etc.
Embodiment described above only expresses the several embodiments of the present invention, and its description is more specific and detailed, but simultaneously Therefore the limitation to the scope of the claims of the present invention can not be interpreted as.It should be pointed out that for one of ordinary skill in the art For, without departing from the inventive concept of the premise, various modifications and improvements can be made, these belong to the guarantor of the present invention Protect scope.Therefore, the protection domain of patent of the present invention should be determined by the appended claims.

Claims (10)

  1. A kind of 1. log information lookup method, it is characterised in that including:
    Keyword to be found, log-file information to be found and the server info to be found of user's input are obtained, it is described to be checked Log-file information is looked for include journal file name to be found and journal file path to be found;
    According to corresponding to the server info to be found and journal file path to be found from the server info to be found Journal file to be found corresponding to the journal file name to be found is obtained on server, and the journal file to be found is protected Deposit into default local address;
    Searched according to the keyword to be found in the default local address and institute is included in the journal file to be found State the log information of keyword to be found.
  2. 2. according to the method for claim 1, it is characterised in that described according to the server info to be found and to be found It is corresponding that the journal file name to be found is obtained corresponding to journal file path from the server info to be found on server Journal file to be found, and the journal file to be found preserved to default local address included:
    Judge whether include date and time information in the journal file name to be found, if so, then replacing the filename to be found Into the filename to be found comprising the default date, according to the server info to be found and journal file path to be found from institute State to be checked corresponding to the filename to be found comprising the default date described in being obtained corresponding to server info to be found on server Journal file is looked for, and journal file to be found corresponding to the filename to be found comprising the default date is preserved to default In local address;
    If it is not, then according to the server info to be found and journal file path to be found from the server info to be found Journal file corresponding with the journal file name to be found is obtained on corresponding server to be found, according to the day to be found Journal file corresponding to will filename obtains journal file to be found corresponding to the default date, and by corresponding to the default date Journal file to be found is preserved into default local address.
  3. 3. according to the method for claim 2, it is characterised in that described to be obtained according to the journal file and preset the date pair The journal file to be found answered includes:
    Traveled through from the journal file tail row to the journal file first trip, when detecting the word that includes the default date Duan Shi, start to obtain the information of the journal file;
    When detecting that including default the previous day on date corresponds to the field on date, terminate to obtain the information of the journal file;
    According to journal file to be found corresponding with the default date described in the generation of the information of the journal file got.
  4. 4. according to the method for claim 1, it is characterised in that it is described according to the keyword to be found described default The log information comprising the keyword to be found in the journal file to be found is searched in local address to be included:
    The journal file to be found is searched in the default local address according to the keyword to be found, obtained with institute State the log information for the default line number that keyword to be found is starting point.
  5. 5. according to the method for claim 1, it is characterised in that described according to the server info to be found and to be found It is corresponding that the journal file name to be found is obtained corresponding to journal file path from the server info to be found on server Journal file to be found include:
    Type of server to be found is obtained according to the server info to be found;
    According to corresponding to the server info to be found and journal file path to be found from the type of server to be found Journal file to be found corresponding to the journal file name to be found is obtained on server.
  6. 6. a kind of log information searches device, it is characterised in that including:
    Data obtaining module, for obtaining keyword to be found, log-file information to be found and the clothes to be found of user's input Business device information, the log-file information to be found include journal file name to be found and journal file path to be found;
    Journal file acquisition module, for being treated according to the server info to be found and journal file path to be found from described Search and obtain journal file to be found corresponding to the journal file name to be found corresponding to server info on server, and will The journal file to be found is preserved into default local address;
    Log information searching modul, for treating described in being searched according to the keyword to be found in the default local address Search the log information for including the keyword to be found in journal file.
  7. 7. device according to claim 6, it is characterised in that the journal file acquisition module is additionally operable to treat described in judgement Search in journal file name and whether include date and time information, if so, then the filename to be found was substituted for comprising the default date Filename to be found, according to the server info to be found and journal file path to be found from the server to be found Journal file to be found corresponding to the filename to be found comprising the default date is obtained corresponding to information on server, and will Journal file to be found corresponding to the filename to be found comprising the default date is preserved into default local address;
    If it is not, then according to the server info to be found and journal file path to be found from the server info to be found Journal file corresponding with the journal file name to be found is obtained on corresponding server to be found, according to the day to be found Journal file corresponding to will filename obtains journal file to be found corresponding to the default date, and by corresponding to the default date Journal file to be found is preserved into default local address.
  8. 8. device according to claim 7, it is characterised in that the journal file acquisition module is additionally operable to from the daily record End-of-file row is traveled through to the journal file first trip, when detecting the field comprising the default date, starts to obtain The information of the journal file;
    When detecting that including default the previous day on date corresponds to the field on date, terminate to obtain the information of the journal file;With And
    According to journal file to be found corresponding with the default date described in the generation of the information of the journal file got.
  9. 9. device according to claim 6, it is characterised in that the log information searching modul is additionally operable to treat according to Search key searches the journal file to be found in the default local address, obtains with the keyword to be found For the log information of the default line number of starting point.
  10. 10. device according to claim 6, it is characterised in that the journal file acquisition module is additionally operable to according to Server info to be found obtains type of server to be found;And
    According to corresponding to the server info to be found and journal file path to be found from the type of server to be found Journal file to be found corresponding to the journal file name to be found is obtained on server.
CN201611154471.3A 2016-12-14 2016-12-14 Log information lookup method and device Pending CN107784050A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611154471.3A CN107784050A (en) 2016-12-14 2016-12-14 Log information lookup method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611154471.3A CN107784050A (en) 2016-12-14 2016-12-14 Log information lookup method and device

Publications (1)

Publication Number Publication Date
CN107784050A true CN107784050A (en) 2018-03-09

Family

ID=61437543

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611154471.3A Pending CN107784050A (en) 2016-12-14 2016-12-14 Log information lookup method and device

Country Status (1)

Country Link
CN (1) CN107784050A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109586968A (en) * 2018-12-13 2019-04-05 北京锐安科技有限公司 The log processing method of big data platform and the log processing system of big data platform
CN110096485A (en) * 2019-03-18 2019-08-06 平安普惠企业管理有限公司 Log inquiring method, device, computer equipment and storage medium
CN110968683A (en) * 2019-12-06 2020-04-07 紫光云(南京)数字技术有限公司 CLI log analysis method based on multiprocessing
CN111045846A (en) * 2019-12-06 2020-04-21 紫光云(南京)数字技术有限公司 Logging analysis method based on swing
CN111078657A (en) * 2019-12-26 2020-04-28 北京思特奇信息技术股份有限公司 Service log query method, system, medium and equipment of distributed system
WO2020088326A1 (en) * 2018-10-31 2020-05-07 京东方科技集团股份有限公司 Interface operation and maintenance method and apparatus
CN112910994A (en) * 2021-01-29 2021-06-04 重庆长安汽车股份有限公司 Remote uploading and acquiring method for application logs
CN113765694A (en) * 2021-03-24 2021-12-07 北京京东拓先科技有限公司 Log information display method and device, electronic equipment and computer readable medium
CN114785677A (en) * 2022-04-22 2022-07-22 武汉联影医疗科技有限公司 Log management method, apparatus, computer device, storage medium, and program product

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102135988A (en) * 2011-03-09 2011-07-27 深圳市茁壮网络股份有限公司 Data query method and client
CN102780726A (en) * 2011-05-13 2012-11-14 中兴通讯股份有限公司 Log analysis method and log analysis system based on WEB platform
CN102984204A (en) * 2012-10-31 2013-03-20 广东欧珀移动通信有限公司 Method of accessing application program and mobile intelligent terminal
CN103064933A (en) * 2012-12-24 2013-04-24 华为技术有限公司 Data query method and system
CN103853743A (en) * 2012-11-29 2014-06-11 百度在线网络技术(北京)有限公司 Distributed system and log query method thereof
CN105677829A (en) * 2016-01-04 2016-06-15 陈华锋 Retrieving method and system
CN105824958A (en) * 2016-03-31 2016-08-03 广州华多网络科技有限公司 Method, device and system for inquiring log
CN106130782A (en) * 2016-07-19 2016-11-16 努比亚技术有限公司 A kind of method and system obtaining server log

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102135988A (en) * 2011-03-09 2011-07-27 深圳市茁壮网络股份有限公司 Data query method and client
CN102780726A (en) * 2011-05-13 2012-11-14 中兴通讯股份有限公司 Log analysis method and log analysis system based on WEB platform
CN102984204A (en) * 2012-10-31 2013-03-20 广东欧珀移动通信有限公司 Method of accessing application program and mobile intelligent terminal
CN103853743A (en) * 2012-11-29 2014-06-11 百度在线网络技术(北京)有限公司 Distributed system and log query method thereof
CN103064933A (en) * 2012-12-24 2013-04-24 华为技术有限公司 Data query method and system
CN105677829A (en) * 2016-01-04 2016-06-15 陈华锋 Retrieving method and system
CN105824958A (en) * 2016-03-31 2016-08-03 广州华多网络科技有限公司 Method, device and system for inquiring log
CN106130782A (en) * 2016-07-19 2016-11-16 努比亚技术有限公司 A kind of method and system obtaining server log

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020088326A1 (en) * 2018-10-31 2020-05-07 京东方科技集团股份有限公司 Interface operation and maintenance method and apparatus
US11681697B2 (en) 2018-10-31 2023-06-20 Boe Technology Group Co., Ltd. Method and device for interface operation and maintenance
CN109586968A (en) * 2018-12-13 2019-04-05 北京锐安科技有限公司 The log processing method of big data platform and the log processing system of big data platform
CN110096485A (en) * 2019-03-18 2019-08-06 平安普惠企业管理有限公司 Log inquiring method, device, computer equipment and storage medium
CN111045846B (en) * 2019-12-06 2022-11-01 紫光云(南京)数字技术有限公司 Logging analysis method based on swing
CN111045846A (en) * 2019-12-06 2020-04-21 紫光云(南京)数字技术有限公司 Logging analysis method based on swing
CN110968683A (en) * 2019-12-06 2020-04-07 紫光云(南京)数字技术有限公司 CLI log analysis method based on multiprocessing
CN111078657A (en) * 2019-12-26 2020-04-28 北京思特奇信息技术股份有限公司 Service log query method, system, medium and equipment of distributed system
CN112910994A (en) * 2021-01-29 2021-06-04 重庆长安汽车股份有限公司 Remote uploading and acquiring method for application logs
CN113765694A (en) * 2021-03-24 2021-12-07 北京京东拓先科技有限公司 Log information display method and device, electronic equipment and computer readable medium
CN113765694B (en) * 2021-03-24 2024-04-19 北京京东拓先科技有限公司 Log information display method, device, electronic equipment and computer readable medium
CN114785677A (en) * 2022-04-22 2022-07-22 武汉联影医疗科技有限公司 Log management method, apparatus, computer device, storage medium, and program product
CN114785677B (en) * 2022-04-22 2023-12-22 武汉联影医疗科技有限公司 Log management method, device, computer equipment, storage medium and program product

Similar Documents

Publication Publication Date Title
CN107784050A (en) Log information lookup method and device
KR101672349B1 (en) File cloud service apparatus and method
CN105940410A (en) Scrubber to remove personally identifiable information
CN110084053A (en) Data desensitization method, device, electronic equipment and storage medium
KR20140056004A (en) Security through metadata orchestrators
JP2001175596A (en) Device and method for processing command and recording medium with program recorded thereon
CN102053973A (en) Device and method for providing page navigation in multi-character supporting network application
JP4824750B2 (en) Confidential information management program, method and apparatus
CN102147736B (en) Method and device for installing software
CN106547791A (en) A kind of data access method and system
CN113326363A (en) Searching method and device, prediction model training method and device, and electronic device
CN102197363B (en) A device for selecting and configuring a default storage section and the corresponding method
US11868412B1 (en) Data enrichment systems and methods for abbreviated domain name classification
CN116781316A (en) Multi-terminal login management method, terminal, server side and storage medium
CN112866005B (en) Method, device and equipment for processing user access log and storage medium
JP5790768B2 (en) Search method and information management apparatus
CN114006868A (en) Flow screening method and device
CN106302821A (en) A kind of data request method and equipment thereof
CN106446132A (en) Search processing method and device
JP2007193574A (en) Management/search method of histories of downloaded files
EP3661158A1 (en) Restrict transmission of manipulated content in a networked environment
CN111177737A (en) Data encryption method based on data content and related device
EP3786825B1 (en) Natural language processing systems and methods for automatic reduction of false positives in domain discovery
KR20040072703A (en) Method for personal parameter list management for an audio and/or video device
CN112702445B (en) Recursive log extraction method and device based on DNS response data message

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20180309

RJ01 Rejection of invention patent application after publication