Log analysis method, log analysis platform, and computer program product
Patent Information
- Application Number
- CN202210892205.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-27
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2042-07-27
AI Technical Summary
随着应用程序的数量增多,日志解析的分散,容易出现不同开发团队重复作业的情况,效率较低
[0015] This application provides log parsing services to development teams of different applications through a unified log parsing platform, avoiding repetitive work and improving efficiency. Furthermore, after a user initiates a log parsing request through the platform's front-end, the back-end can parse the application name, the business name under the application, and the scenario type name under the business from the request, forming a corresponding query index to accurately locate the necessary log parsing plugin. The back-end can also parse the log file name from the request to find the log to be parsed, and then use the log parsing plugin found in the query index to parse the log, thus completing the parsing of the corresponding application's logs.
Smart Images

Figure CN115203129B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of log processing technology, and in particular to a log parsing method, a log parsing platform, and a computer program product. Background Technology
[0002] During application operation, corresponding logs are generated. By parsing these logs, the application development team can effectively locate application faults.
[0003] Log parsing for each application is typically distributed across the respective application development teams. As the number of applications increases, this fragmented log parsing can easily lead to duplicated tasks among different development teams, resulting in low efficiency. Summary of the Invention
[0004] Therefore, it is necessary to provide a log parsing method, a log parsing platform, and a computer program product to address the aforementioned technical problems.
[0005] This application provides a log parsing method that can be applied to the backend of a log parsing platform. The method includes:
[0006] Obtain log parsing requests initiated by users through the front end of the log parsing platform;
[0007] The log file name is parsed from the log parsing request, and the log found by the log file name is taken as the log to be parsed;
[0008] The application name, the business name under the application, and the scenario type name under the business are parsed from the log parsing request, and a query index is formed.
[0009] If a log parsing plugin is found through the query index, the log to be parsed is parsed using the found log parsing plugin to obtain the log parsing result, and the log parsing result is fed back to the front end so that the user can know the log parsing result through the front end.
[0010] This application provides a log parsing method that can be applied to the front end of a log parsing platform. The method includes:
[0011] The user-initiated log parsing request is sent to the backend of the log parsing platform, so that the backend performs the following steps: parsing the log file name from the log parsing request, and taking the log found by the log file name as the log to be parsed; parsing the application name, the business name under the application, and the scenario type name under the business from the log parsing request, and forming a query index; if a log parsing plugin is found through the query index, the found log parsing plugin is used to parse the log to be parsed to obtain the log parsing result;
[0012] The log parsing results from the backend are then fed back to the user.
[0013] This application provides a log parsing platform, including a memory and a processor, wherein the memory stores a computer program and the processor executes the steps of the above method.
[0014] This application provides a computer program product having a computer program stored thereon, wherein the computer program is executed by a processor to perform the steps of the above method.
[0015] This application provides log parsing services to development teams of different applications through a unified log parsing platform, avoiding repetitive work and improving efficiency. Furthermore, after a user initiates a log parsing request through the platform's front-end, the back-end can parse the application name, the business name under the application, and the scenario type name under the business from the request, forming a corresponding query index to accurately locate the necessary log parsing plugin. The back-end can also parse the log file name from the request to find the log to be parsed, and then use the log parsing plugin found in the query index to parse the log, thus completing the parsing of the corresponding application's logs. Attached Figure Description
[0016] Figure 1 This is a flowchart illustrating a log parsing method in one embodiment;
[0017] Figure 2 This is a diagram illustrating the application environment of the log parsing method in another embodiment;
[0018] Figure 3 This is a diagram of an application environment for log parsing based on regular expressions in one embodiment.
[0019] Figure 4 This is a diagram of an application environment for log parsing based on a log parsing plugin, as shown in one embodiment.
[0020] Figure 5 This is a flowchart illustrating the log parsing method in another embodiment;
[0021] Figure 6 This is a schematic diagram of the log parsing page displayed on the front end in one embodiment;
[0022] Figure 7 This is a schematic diagram of the log parsing page displayed on the front end in another embodiment;
[0023] Figure 8 This is an internal structure diagram of the backend in one embodiment;
[0024] Figure 9This is an internal structure diagram of the front end in one embodiment. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0026] In this application, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described in this application can be combined with other embodiments.
[0027] This application provides a log parsing method that can be applied to the backend of a log parsing platform, such as... Figure 1 As shown, the method includes:
[0028] Step S101: The backend obtains the log parsing request initiated by the user through the frontend of the log parsing platform.
[0029] In a log parsing platform, the part directly facing users such as the development team is called the front end, such as a browser, while the part not directly facing users is called the back end. This log parsing platform enables one-click automated log parsing to determine the cause of errors, eliminating the need for manual log reading and analysis and improving the efficiency of fault location.
[0030] The log parsing platform provides log parsing services for development teams of different applications. Furthermore, the business processes within the same application can be diverse; for example, a singing application might include recording and login functions, and the same function could be further subdivided into different scenario types. Therefore, to achieve granular management of log parsing plugins, the platform can create an index based on the application name, the business names within the application, and the scenario type names within those business types, and then store the index along with the corresponding log parsing plugins.
[0031] Log parsing plugins can include scripts written in appropriate programming languages, such as Python or Shell. These plugins can be stored on an object storage server, which may be based on COS (Cloud Object Storage) technology.
[0032] Specifically, the front end can optionally display a set of application names, a set of business names under the application, and a set of scenario type names under the business. Then, the front end generates a log parsing request based on the application name, business name under the application, and scenario type name under the business selected by the user and sends it to the back end.
[0033] In step S102, the backend parses the log file name from the log parsing request and uses the log found by the log file name as the log to be parsed.
[0034] In step S103, the backend parses the application name, the business name under the application, and the scenario type name under the business from the log parsing request, and forms a query index.
[0035] Step S104: If the log parsing plugin is found by querying the index, the log to be parsed is parsed using the found log parsing plugin to obtain the log parsing result, and the log parsing result is fed back to the front end so that the user can know the log parsing result through the front end.
[0036] After receiving the log parsing results, the front-end can display them on the front-end page according to different dimensions such as timeline and log level.
[0037] This embodiment provides log parsing services to development teams of different applications through a unified log parsing platform, avoiding repetitive work and improving efficiency. Furthermore, after a user initiates a log parsing request through the front-end of the platform, the back-end can parse the application name, the business name under the application, and the scenario type name under the business from the request, forming a corresponding query index to accurately locate the log parsing plugin needed for parsing the logs. The back-end can also parse the log file name from the request to find the log to be parsed, and then use the log parsing plugin found in the query index to parse the log to be parsed, completing the parsing of the corresponding application's logs.
[0038] like Figure 2 As shown, the log parsing platform's backend can integrate various log parsing logics. Users initiate log parsing requests to the backend through the frontend. The backend parses the log filename from the request to determine the log to be parsed. Then, the backend retrieves the log to be parsed from the cloud. The backend uses the corresponding log parsing logic to parse the log, obtains the log parsing result, and feeds the result back to the frontend. After receiving the log parsing result through the frontend, users can provide corresponding solutions to fix bugs (faults).
[0039] For scenarios with lower complexity, the log parsing logic can be hard-coded into the log parsing platform. The platform needs to support configurable log parsing logic, which can be implemented using JSON-formatted log parsing rules, including regular expressions. Therefore, the log parsing platform supports not only log parsing through plugins but also log parsing based on established rules.
[0040] If the log parsing platform also supports log parsing based on log parsing rules, the backend, after forming a query index, will use the regular expression found in the index to parse the log to be parsed, and obtain the log parsing result.
[0041] When the regular expression is stored as a serialized form, the background process of parsing the log to be parsed using the found regular expression and obtaining the log parsing result can specifically perform the following steps: deserializing the found regular expression; and using the deserialized regular expression to parse the log to be parsed and obtain the log parsing result.
[0042] Different log parsing logics can be understood as log parsing rules in JSON format, which define the following:
[0043] (1) The log parsing platform generates an index corresponding to the log parsing rules based on the application name, the business name under the application, and the scenario type name under the business. The specific form of the index can be an ID (unique identifier).
[0044] (2) Fields of the filter (filter) regular expression used to match text;
[0045] (3) The key field used for string replacement in mapping rules.
[0046] By combining the key and filter in the backend, the corresponding content can be extracted from the logs to obtain the log parsing results.
[0047] like Figure 3 As shown, when a user adds a log parsing rule, the specific steps may include the following:
[0048] (1) Users select the application name, business name and scenario type name through the front end according to their own needs, and write regular expressions and mapping rules according to their own keywords.
[0049] (2) If the analysis of a certain scenario type may involve multiple keywords, multiple regular expressions and mapping rules can be written;
[0050] (3) After the code is written on the front end, the front end uploads the regular expression and mapping rules to the back end;
[0051] (4) The backend uses a hash algorithm to generate a unique index for each regular expression and mapping rule based on the application name, business name and scenario type name selected by the user. The regular expression and mapping rule are serialized into strings, and the index is used as the key and the string is used as the value to form a key-value pair and stored in Redis.
[0052] The process of adding the above log parsing rules does not require adding any extra files or modifying the relevant code of the log parsing platform. All rules are added and modified dynamically. In this way, the log parsing strategies are endless, diverse, and highly customizable for users. Users can add JSON rules directly to the log parsing platform to determine what analysis strategy they need, without having to redeploy.
[0053] If the log parsing platform also supports log parsing based on log parsing rules, the interaction between the backend and the frontend can include:
[0054] (1) When the user enters the log parsing page provided by the front end, the user selects the log file name to be parsed, the application name, business name and scenario type name to form the index of the regular expression to be used. After the user clicks the confirmation button, the front end sends the log parsing request in HTTP form to the back end.
[0055] (2) After receiving the log parsing request, the backend parses out the relevant request parameters, including the log file name, application name, business name and scenario type name, and temporarily downloads the log to be parsed to the machine where the backend is located by the log file name.
[0056] (3) The backend forms a query index based on the parsed application name, business name and scenario type name, retrieves the string corresponding to the query index in Redis, and deserializes the retrieved string to obtain the regular expression to be used.
[0057] (4) Open the log to be parsed in the background, use the regular expression parsing engine to scan the log line by line, and determine whether the log content of the current line matches the regular expression.
[0058] a) If no match is found, scan the next row;
[0059] b) If a match is found, the current row's time, corresponding operation information, parameter information, and mapping result are assembled into an operation object and stored.
[0060] (5) After the backend scans the logs to be parsed, it obtains the log parsing results including multiple operation objects, sorts them by time, and sends them back to the frontend so that the frontend can display them in chronological order. The backend can also delete temporarily downloaded logs to be parsed.
[0061] While regular expressions can automate the analysis and location of most common problems, the configured regular expressions are fixed, limiting the supported scenarios and parsing logic. Furthermore, some users may not be accustomed to writing complex regular expressions. Therefore, log parsing platforms support log parsing through log parsing plugins, enabling highly customized log parsing. Within these plugins, users can implement more complex and targeted parsing logic.
[0062] In addition, such as Figure 4 As shown, users can write the corresponding log parsing logic into a log parsing plugin using Python or shell according to their own needs and scenarios, and upload it to the backend for saving.
[0063] Specifically, the backend can obtain the log parsing plugins written by users through the frontend; and the backend can determine the application name, the business name under the application, and the scenario type name under the business corresponding to the written log parsing plugin, and form an index; and store the written log parsing plugins and the index accordingly.
[0064] In one embodiment, when the written log parsing plugin and index are stored on an object storage server, the backend can use the query index to search in local storage when determining the log parsing plugin corresponding to the query index. If the log parsing plugin or regular expression is not found in local storage, the query index is used to search in the object storage server.
[0065] After finding the log parsing plugin corresponding to the query index, the backend can execute the log parsing plugin's script through the plugin parsing engine to parse the logs to be parsed, obtain the log parsing results, and feed them back to the frontend.
[0066] Since the front-end displays log parsing results in a specific output format, the log parsing results need to include relevant content so that the front-end can display them according to this format. Therefore, when users write log parsing plugins for the front-end, the back-end can determine the content that the log parsing plugin must include based on the output format used by the front-end to display the log parsing results, allowing users to write their log parsing plugins accordingly.
[0067] Specifically, the content to be included can be:
[0068] (1) 5 global variables:
[0069] gKeyWord: Can be modified according to user naming habits. It must contain the keyword you want to search for, or it can be an array of keywords to search for multiple keywords; it can also be a regular expression.
[0070] gParserResultMsg: Based on the user's actual situation, this specifies which keywords were matched in the logs and what type of failure message they correspond to. Like the keywords, it can be an array.
[0071] gCurLine: The variable name cannot be modified. It is used to record the log line number that matches the keyword (and target value) or regular expression.
[0072] gResList: The variable name cannot be modified; it stores all parserRes objects.
[0073] gLogFile: Cannot be modified. It points to an already opened log file that is yet to be parsed. The log file path is passed in from the command-line arguments, corresponding to the file open operation.
[0074] (2) Define the parserRes class:
[0075] For each line of log content hit, a parserRes object needs to be generated. The member variable names in the parserRes object cannot be modified. The parserRes object will be parsed into JSON format. The log parsing platform's front-end output of log parsing results depends on this JSON format content.
[0076] (3) Parsing logic and parsing result processing:
[0077] The parsing logic is user-defined, but each time a log line matches a relevant rule, the parsing result needs to be processed: each parsing result should be appended to the global log parsing result array. The second parameter represents the matching rule (keyword or regular expression) for the current log line, which can be modified as needed.
[0078] (4) File closing operation:
[0079] The purpose of closing this file is primarily to prevent resource leaks.
[0080] (5) JSON formatting:
[0081] The log parsing results are stored in a global array. This array needs to be formatted as JSON and then output. The front end of the log parsing platform depends on the content of this JSON format when outputting the log parsing results.
[0082] If the user wants to perform log parsing using a log parsing plugin, see again. Figure 4 The interaction between the backend and the frontend can include:
[0083] (1) The front end displays the log parsing page to the user. With the default log parsing method being regular expression, on the log parsing page, the user selects the log file name to be parsed, the application name, business name, and scenario type name to form the index of the regular expression to be used. After the user clicks the confirmation button, the front end sends the log parsing request in HTTP form to the back end.
[0084] (2) After receiving the log parsing request, the backend parses out the relevant request parameters, including the log file name, application name, business name and scenario type name, and temporarily downloads the log to be parsed to the machine where the backend is located by the log file name; and the backend forms a query index based on the parsed application name, business name and scenario type name.
[0085] (3) The backend can first check whether there is a log parsing plugin corresponding to the query index in the local storage. If not, it can use the query index to search the object storage server and download the found log parsing plugin to the machine where the backend is located.
[0086] (4) The background system calls to start the plugin parsing engine, executes the log parsing plugin script, and parses the logs to be parsed.
[0087] (5) After the backend finishes parsing the logs to be parsed, it obtains a set of operation objects, sorts them by time, and sends them back to the frontend so that the frontend can display them in chronological order.
[0088] (6) The background can delete temporarily downloaded logs that are yet to be parsed, but it does not need to delete the log parsing plugin downloaded from the object storage server.
[0089] The reason for deleting logs to be parsed is that the logs are too large, easily filling up disk space compared to the log parsing plugin. Furthermore, the effective lifespan of a log is only one week, while the plugin's lifespan is indefinite. Saving the log parsing plugin acts as a cache, speeding up log parsing. If the log parsing plugin is needed later, it doesn't need to be downloaded from the object storage server.
[0090] This application provides a log parsing method that can be applied to the front end of a log parsing platform, such as... Figure 5 As shown, the method includes:
[0091] Step S501: The front end sends the log parsing request initiated by the user to the back end of the log parsing platform.
[0092] After receiving the log parsing request, the backend performs the following steps: parses the log file name from the log parsing request, and uses the log found by the log file name as the log to be parsed; parses the application name, the business name under the application, and the scenario type name under the business from the log parsing request, and forms a query index; if the log parsing plugin is found through the query index, the found log parsing plugin is used to parse the log to be parsed to obtain the log parsing result.
[0093] In step S502, the front end sends the log parsing results from the back end back to the user.
[0094] This embodiment provides log parsing services to development teams of different applications through a unified log parsing platform, avoiding repetitive work and improving efficiency. Furthermore, after a user initiates a log parsing request through the front-end of the platform, the back-end can parse the application name, the business name under the application, and the scenario type name under the business from the request, forming a corresponding query index to accurately locate the log parsing plugin needed for parsing the logs. The back-end can also parse the log file name from the request to find the log to be parsed, and then use the log parsing plugin found in the query index to parse the log to be parsed, completing the parsing of the corresponding application's logs.
[0095] Furthermore, before sending the user-initiated log parsing request to the log parsing platform's backend, the frontend can also perform the following steps: optionally display the set of application names used to form the index, the set of business names under the application, and the set of scenario type names under the business; and form a log parsing request based on the user-selected application name, the business name under the application, and the scenario type name under the business.
[0096] After the front-end sends the log parsing results from the back-end back to the user, it can also perform the following steps: continue to display the application name set, the business name set under the application, and the scenario type name set under the business in an optional form; when the user selects at least one of the new application name, the new business name under the application, and the new scenario type name under the business, a new log parsing request is generated; the new log parsing request is sent to the back-end so that the back-end can send the corresponding log parsing results.
[0097] For example, such as Figure 6As shown, the front end can display the log parsing page on the monitor. In this log parsing page, the set of application names used to form the index, the set of business names under the application, and the set of scenario type names under the business can be displayed in an optional form. In addition, the log parsing page also includes a display area for logs to be parsed, which can display the logs to be parsed; the log parsing page also includes a log parsing result display area, which can display the log parsing results.
[0098] When the log file name is based on the application ID, the user ID of the application, the application version number, and the log upload time, the front end can also parse the above information from the log file name and display it on the log parsing page.
[0099] When the default parsing method is based on regular expressions for log parsing, if the user needs to use a log parsing plugin, such as... Figure 7 As shown, users can enable the plugin parsing switch on the log parsing page, specify the sub-function type and additional plugin parameters as needed, and finally click the confirm button to start parsing. The sub-function type and plugin parameters are optional and can be left blank, depending on the requirements.
[0100] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0101] In one embodiment, a log parsing platform is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps in the various method embodiments described above.
[0102] In one embodiment, the log parsing platform may include a terminal as its foreground, and its internal structure diagram may be as follows: Figure 8As shown, the computer device includes a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. The computer device also includes input / output interfaces, which are connection circuits for exchanging information between the processor and external devices. These interfaces are connected to the processor via a bus and are referred to as I / O interfaces. When the computer program is executed by the processor, it implements a log parsing method. The display screen can be an LCD screen or an e-ink display screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad located on the computer device casing, or an external keyboard, touchpad, or mouse.
[0103] In one embodiment, the log parsing platform may include a backend server, the internal structure of which can be as follows: Figure 9 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores log parsing data. The network interface communicates with external terminals via a network connection. The computer device also includes input / output interfaces, which are connection circuits between the processor and external devices for exchanging information; they are connected to the processor via a bus and are referred to as I / O interfaces. When the computer program is executed by the processor, it implements a log parsing method.
[0104] Those skilled in the art will understand that Figure 8 and Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0105] In one embodiment, a computer program product is provided having a computer program stored thereon, the computer program being executed by a processor of the steps described in the various method embodiments above.
[0106] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0107] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0108] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0109] The above embodiments are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A log parsing method characterized by, The method, applied to the backend of a log parsing platform, includes: Obtain log parsing requests initiated by users through the front end of the log parsing platform; The log file name is parsed from the log parsing request, and the log found by the log file name is taken as the log to be parsed; The application name, the business name under the application, and the scenario type name under the business are parsed from the log parsing request, and a query index is formed. If a log parsing plugin is found through the query index, the log to be parsed is parsed using the found log parsing plugin to obtain the log parsing result, and the log parsing result is fed back to the front end so that the user can know the log parsing result through the front end; Receive new log parsing requests and send the corresponding log parsing results back to the front end; The log parsing request is generated on the front end through the following steps: displaying a log file name input field on the log parsing page, and displaying, in the form of optional elements, a set of application names used to form an index, a set of business names under the application, and a set of scenario type names under the business; and forming a log parsing request based on the log file name entered by the user in the log file name input field, the application name selected in the optional form, the business name under the application, and the scenario type name under the business. A new log parsing request is generated on the front end through the following steps: continue to display the set of application names, the set of business names under the application, and the set of scenario type names under the business in an optional form; when the user selects at least one of the new application name, the new business name under the application, and the new scenario type name under the business in an optional form, a new log parsing request is generated.
2. The method according to claim 1, characterized in that, After the query index is created, the method further includes: If a regular expression is found through the index, the found regular expression is used to parse the log to be parsed, and the log parsing result is obtained.
3. The method according to claim 2, characterized in that, When the regular expression is stored as a serialized format, the step of using the found regular expression to parse the log to be parsed and obtaining the log parsing result includes: Deserialize the found regular expression; The log to be parsed is then parsed using the deserialized regular expression to obtain the log parsing result.
4. The method according to claim 1, characterized in that, The method further includes: Obtain the log parsing plugin written by the user on the front end; Determine the application name, business name under the application, and scenario type name under the business for the log parsing plugin you are writing, and create an index; Store the written log parsing plugins and indexes accordingly.
5. The method according to claim 4, characterized in that, Before obtaining the log parsing plugin written by the user on the front end, the method further includes: Based on the output format used by the front-end to output log parsing results, determine the content that the log parsing plugin should include, so that users can write log parsing plugins according to the content that the log parsing plugin should include.
6. The method according to claim 4, characterized in that, When the log parsing plugin and index are stored on an object storage server, the method further includes: The query index is used to search in local storage. If the log parsing plugin or regular expression is not found in local storage, the query index is used to search in the object storage server.
7. The method according to claim 1, characterized in that, Using the found log parsing plugin, the log to be parsed is parsed, including: Start the plugin parsing engine, execute the script of the log parsing plugin, and parse the log to be parsed.
8. A log parsing method, characterized in that, The method, applied to the front end of a log parsing platform, includes: The log parsing page displays a log file name input field, and on the log parsing page, the set of application names used to form the index, the set of business names under the application, and the set of scenario type names under the business are displayed as optional elements. A log parsing request is generated based on the log file name entered by the user in the log file name input field, the application name selected by the user in the optional form, the business name under the application, and the scenario type name under the business. The user-initiated log parsing request is sent to the backend of the log parsing platform, so that the backend performs the following steps: parsing the log file name from the log parsing request, and taking the log found by the log file name as the log to be parsed; parsing the application name, the business name under the application, and the scenario type name under the business from the log parsing request, and forming a query index; if a log parsing plugin is found through the query index, the found log parsing plugin is used to parse the log to be parsed to obtain the log parsing result; The log parsing results from the backend are then fed back to the user. Continue to display the set of application names, the set of business names under the application, and the set of scenario type names under the business in an optional form; A new log parsing request is generated when the user selects at least one of the following options: a new application name, a new business name under the application, and a new scenario type name under the business. Send a new log parsing request to the backend so that the backend can provide the corresponding log parsing results.
9. A log parsing platform, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 8.
10. A computer program product having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 8.
Citation Information
Patent Citations
Extraction and analysis method for heterogeneous security log information under complex network system
CN105550378A
Log analysis method and device
CN113934428A